Closed EllieFar closed 1 year ago
Hi, this bug happens due to the incorrect "PYTHONPATH". I don't have the right to modify the google colab ipynb file. You can modify it as follows:
#@title Download libraries and clone git project(run only for first time)
%cd /content/
!git clone https://github.com/aim-uofa/AdelaiDepth
!wget -O /content/AdelaiDepth/LeReS/Minist_Test/res101.pth https://cloudstor.aarnet.edu.au/plus/s/lTIJF4vrvHCAI31/download
import sys
import os
sys.path.append('/content/AdelaiDepth/Minist_Test/LeReS/')
os.environ["PYTHONPATH"] += (":/content/AdelaiDepth/Minist_Test/LeReS")
!echo "$PYTHONPATH"
!pip3 install ipykernel matplotlib opencv-python
!pip3 install torch==1.6.0 torchvision==0.7.0
#cudatoolkit==10.2
from IPython.display import clear_output
clear_output()
#@title Clean output directory
%%shell
if [ -e /content/AdelaiDepth/LeReS/Minist_Test/test_images ]; then
if [ -n "`ls -A /content/AdelaiDepth/LeReS/Minist_Test/test_images/`" ]; then
rm -rf /content/AdelaiDepth/LeReS/Minist_Test/test_images/*
echo "Cleaned"
fi
elif [ ! -e /content/AdelaiDepth/LeReS/Minist_Test/test_images ]; then
mkdir /content/AdelaiDepth/LeReS/Minist_Test/test_images
mkdir /content/AdelaiDepth/LeReS/Minist_Test/test_images/outputs
echo "Created directories and cleaned"
fi
#@title Upload images(png, jpg works fine, also you can upload multiple images)
%cd /content/AdelaiDepth/LeReS/Minist_Test/test_images/
from google.colab import files
image = files.upload()
#for n in image.keys():
# print("{name} succesfully uploaded!".format(name = n))
#@title Run network
%cd /content/AdelaiDepth/LeReS/Minist_Test
%env PYTHONPATH=/content/AdelaiDepth/LeReS/Minist_Test
!echo "$PYTHONPATH"
!python3 ./tools/test_depth.py --load_ckpt res101.pth --backbone resnext101
!echo "Done!"
#@title Download results
from google.colab import files
%cd /content/AdelaiDepth/LeReS/Minist_Test/test_images/
!find outputs/ -name "*-depth_raw.png" | zip -r result.zip -@
files.download("result.zip")
@guangkaixu Thank you very much for your response. It resolved the issue!
Hi. Thanks for your nice work. I tried to run AdelaiDepth_ResNet101.ipynb (here) but I got error like:
Traceback (most recent call last): File "/content/AdelaiDepth/LeReS/Minist_Test/tools/test_depth.py", line 9, in
from lib.multi_depth_model_woauxi import RelDepthModel
ModuleNotFoundError: No module named 'lib'
I tried below solution mentioned in https://github.com/aim-uofa/AdelaiDepth/issues/11#issuecomment-953388438. but still didn't work.
I also tried below solution mentioned in https://github.com/aim-uofa/AdelaiDepth/issues/7, but did not work
Do you have any idea how can I solve it? I would appreciate it.