Open szy4017 opened 3 years ago
I found one of the reasons for this error is that the compiler can't find the 'cpu.py'. In particular, because the name of package is the same as the name of project file, the compiler is confused.
A simple solution is that we can copy the files in packeage enconding
to project dir encoding
.
The comands are as follows.
cp /home/user/.conda/envs/Pytorch-Encoding/lib/python3.6/site-packages/torch_encoding-1.2.2b20210908-py3.6-linux-x86_64.egg/encoding/cpu.py /home/user/PyTorch-Encoding/encoding/
cp /home/user/.conda/envs/Pytorch-Encoding/lib/python3.6/site-packages/torch_encoding-1.2.2b20210908-py3.6-linux-x86_64.egg/encoding/cpu.cpython-36m-x86_64-linux-gnu.so /home/user/PyTorch-Encoding/encoding/
cp /home/user/.conda/envs/Pytorch-Encoding/lib/python3.6/site-packages/torch_encoding-1.2.2b20210908-py3.6-linux-x86_64.egg/encoding/gpu.py /home/user/PyTorch-Encoding/encoding/
cp /home/user/.conda/envs/Pytorch-Encoding/lib/python3.6/site-packages/torch_encoding-1.2.2b20210908-py3.6-linux-x86_64.egg/encoding/gpu.cpython-36m-x86_64-linux-gnu.so /home/user/PyTorch-Encoding/encoding/
When I run this command 'python scripts/prepare_ade20k.py' for preparing the dataset, I got this error. I can't import cpu.