Closed vitacon closed 1 year ago
Whew... I made it work.
I had to print sys.path
to find out what's going on.
set PYTHONPATH=
C:\Users\Vita\video\adelai-leres\LeReS\Minist_Test\tools
C:\Users\Vita\Anaconda3\envs\LeReS\python37.zip
etc.
set PYTHONPATH="C:\Users\Vita\video\adelai-leres\LeReS\Minist_Test"
C:\Users\Vita\video\adelai-leres\LeReS\Minist_Test\tools
C:\Users\Vita\video\adelai-leres\LeReS\Minist_Test\"C:\Users\Vita\video\adelai-leres\LeReS\Minist_Test"
C:\Users\Vita\Anaconda3\envs\LeReS\python37.zip
etc.
OMG!
set PYTHONPATH=.
C:\Users\Vita\video\adelai-leres\LeReS\Minist_Test\tools
C:\Users\Vita\video\adelai-leres\LeReS\Minist_Test
C:\Users\Vita\Anaconda3\envs\LeReS\python37.zip
etc.
This looked promising but it was not enough:
loading checkpoint res50.pth
Traceback (most recent call last):
File "tools\test_depth.py", line 65, in <module>
imgs_list = os.listdir(image_dir)
FileNotFoundError: [WinError 3] Systém nemůže nalézt uvedenou cestu: '/test_images/'
So I removed the first slash on line 64:
image_dir = os.path.dirname(os.path.dirname(__file__)) + 'test_images/'
Surprisingly, it was enough. =)
loading checkpoint res50.pth
processing (0000)-th image... test_images/038937.png
processing (0001)-th image... test_images/038938.png
processing (0002)-th image... test_images/038939.png
processing (0003)-th image... test_images/038940.png
processing (0004)-th image... test_images/038941.png
processing (0005)-th image... test_images/038942.png
processing (0006)-th image... test_images/038943.png
processing (0007)-th image... test_images/038944.png
processing (0008)-th image... test_images/038945.png
However, I still don't quite understand why Windows require these two changes...
Hi, the "No module named 'lib'" error happens due to the incorrect PYTHONPATH. For ubuntu, we usually solve it by "export PYTHONPATH=...". I didn't run it on windows, and thanks very much for your attempt and give the final solution.
I'm trying to run LeReS in Anaconda on Windows 10. I had no problem during preinstallation (env, install pytorch etc., pip) but I can't run test_depth.py.
export PYTHONPATH="c:\Users\Vita\video\adelai-leres\LeReS\Minist_Test"
I guess I need to replace Export by Set in Windows.
set PYTHONPATH="c:\Users\Vita\video\adelai-leres\LeReS\Minist_Test"
So I run
python Minist_Test\tools\test_depth.py --load_ckpt res50.pth --backbone resnet50
The file seems to be in the right place:
c:\Users\Vita\video\adelai-leres\LeReS\Minist_Test\lib\multi_depth_model_woauxi.py
I suppose the problem should be fixed by setting the temporary path to Minist_Test\lib but I can't figure out how... =(