Something will be displayed here to help guys smoothly install the torch in anaconda.
- Windows 10
- WSL1 -> Linux Ubuntu-20.04
- Anaconda
- Example:
conda install -c opencv
- Solution:
conda install -c conda-forge opencv
- Source: CSDN Technical Article
- Check PID:
lsof -i :8888
- Kill program:
kill -9 PIP
- Check again whether some port is still used now: jupyter notebook list
- WSL1 is convenient for the local access in terms of using jupyter notebook but is not convenient for the missing function of GPU computing -
torch.cuda.is_available()
.- WSL2 enbles the GPU computing which means
torch.cuda.is_available()
will be true. However, linux system in WSL2 adopts the NAT net structure that results in the inconvenient use of other terminals in LAN.- Solution: change the WSL version without uninstalling and reinstalling operations:
wsl --set-version <distribution name> <versionNumber>
- Parameter - Version: 1 or 2
- Microsoft Source: Basic Command of WSL
Problem 4: Appropriate setting of /home/username/.condarc will speed up the download of relevant python packages
- Tsinghua Mirror: Anaconda Settings
- SUSTech Mirror: Anaconda Settings
- Solution: python -m ipykernel install --user --name
- Edit:
sudo vim /etc/ssh/sshd_config
- Update or Uncomment:
Port 8888 # any port ID you like AddressFamily any ListenAddress 0.0.0.0 ListenAddress :: PasswordAuthentication yes
- Restart sshd:
sudo service ssh --full-restart
- Access by ssh:
ssh username@localhost -p <PortNumber>
- Reference: Zhihu Technical Article
- Open Firewall Port: create a new inbound rule
conn for WSL
- Remove previous port forwarding rules:
netsh interface portproxy delete v4tov4 listenport=8888 listenaddress=0.0.0.0
- Configure Port Mapping:
netsh interface portproxy add v4tov4 listenport=8888 listenaddress=0.0.0.0 connectport=8888 connectaddress=localhost
- I also pack these two sentences into a bat file so that you can run it as an administrator every time you need to access your jupyter notebook in other computers of your LAN. Download it here. Of course, you can edit it to follow your own settings.
- Reference:
- pip install --extra-index-url https://pypi.nvidia.com tensorflow[and-cuda]
- pip install --no-deps tensorflow_hub
- Reference: https://discuss.ai.google.dev/t/installing-tf-hub-without-upgrading-tensorflow/29419
Note: The aforementioned problem sets including their potential solutions are almost collected from different sources. I always try to attach the source link for each item so as to help someone check the initial technical article. If you still have some questions about this, please feel free to contact me here or by Email.