Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
Error still reported after installing torch on Linux:
Traceback (most recent call last):
File "cifar10_tutorial.py", line 58, in <module>
import torch
ImportError: No module named torch
The reason is that you have to configure the environment:
First enter:
vim ~/.bashrc
Add the following statement:
. /home/yourdirectory/torch/install/bin/torch-activate
# added by Anaconda3 installer
export PATH="/home/yourdirectory/anaconda3/bin:$PATH"
Then update the environment variable
source ~/.bashrc
Similar Posts:
- Examples of torch.NN.Functional.Relu() and torch.NN.Relu()
- [Solved] DCNv2 Compile Error: error: identifier “THCudaBlas_SgemmBatched” is undefined
- [Solved] Pytoch nn.CrossEntropyLoss Error: RuntimeError: expected scalar type Long but found Float
- Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same
- PyTorch UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` inst
- [Solved] torch.cuda.CudaError: CUDA driver version is insufficient for CUDA runtime version (35) [ WARN:0
- Error in loading pre training weight in torch. Load() in pytorch
- PytorchStreamReader failed reading zip archive: failed finding central directory
- [Solved] RuntimeError: Attempting to deserialize object on CUDA device 2 but torch.cuda.device_count() is 1
- Error in import torch under linux environment