aim-uofa / AdelaiDepth

This repo contains the projects: 'Virtual Normal', 'DiverseDepth', and '3D Scene Shape'. They aim to solve the monocular depth estimation, 3D scene reconstruction from single image problems.
Creative Commons Zero v1.0 Universal
1.06k stars 144 forks source link

RuntimeError: stack expects a non-empty TensorList #47

Closed lw0210 closed 2 years ago

lw0210 commented 2 years ago

Hi, When I configure the environment as required, I can run sh train_demo.sh with the code that has not been updated before, but running sh train.sh for a period of time will report an error:“AttributeError:‘NoneType’ object has no attribute ‘lower’”。

Download the latest code to run the training code (sh train_demo.sh/sh train.sh). The error display: "runtimeerror: stack expectations a non empty tensorlist". How to solve this problem?

guangkaixu commented 2 years ago

@lw0210 Hi, thanks for reporting this bug!

This bug happens due to the absence of high-quality and mid-quality datasets, and we have fixed this situation in our latest code.

lw0210 commented 2 years ago

Thank you @guangkaixu . I have run the latest code. I can run demo, but run sh train Sh the error message displays "typeerror: 'nonetype' object is not subscribable"

The contents are as follows: Traceback (most recent call last): File "/home/liwei/anaconda3/envs/LeReS/lib/python3.7/site-packages/torch/utils/data/utils/worker.py", line 185, in worker_ loop data = fetcher.fetch(index) File "/home/liwei/anaconda3/envs/LeReS/lib/python3.7/site-packages/torch/utils/data/utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly batched_ index] File "/home/liwei/anaconda3/envs/LeReS/lib/python3.7/site-packages/torch/utils/data/utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly batched_ index] File "/home/liwei/anaconda3/envs/LeReS/lib/python3.7/site-packages/torch/utils/data/dataset.py", line 207, in getitem return self.datasets[dataset_idx][sample_idx] File "/home/liwei/paper31/AdelaiDepth/LeReS/Train/data/multidataset.py", line 79, in getitem data = self.online aug(anno_index) File "/home/liwei/paper31/AdelaiDepth/LeReS/Train/data/multidataset.py", line 114, in online aug rgb = cv2.imread(rgb_path)[:, :, ::-1]# rgb, HWC TypeError: 'NoneType' object is not subscriptable

guangkaixu commented 2 years ago

@lw0210 This error occurs due to the incorrect rgb_path in train_annotation.json. Please prepare the training data following the step 'Training-2' and put it under Train/datasets. If you would like to train on customized datasets, please generate the train_annotation.json first, which contains rgb_path and depth_path at least.

lw0210 commented 2 years ago

I have downloaded the four datasets (in the win system) again and put them in the corresponding positions as required. I still have this error "typeerror: 'nonetype' object is not subscribable" during the operation (Holopix50k is removed) @guangkaixu

guangkaixu commented 2 years ago

@lw0210 The validation datasets should contain depth images rather than disparity images, which has been filtered automatically in our latest released code. Also, please update the annotation files of taskonomy according to download_data.sh.

lw0210 commented 2 years ago

Hello, I passed the command sh train sh to run the training network and get some pth files. I put one of the files into the corresponding folder and run test depth.py or test shape.py, there will be an error keyerror: depth_ model。 I passed ‘torch load()’ command prints res50.pth and the pth I have trained. It shows that res50 contains [depth_model, shift_model, focal_model], my pth contains [step, epoch, batchsize, scheduler, val_err, model_state_dict, optimizer]. How can I get the model weights like res50.pth or res101.pth. @guangkaixu

guangkaixu commented 2 years ago

@lw0210 Hi, Sorry for the late response due to some busy work.

If you want to load the self-trained checkpoint, please follow this to modify your code: https://github.com/aim-uofa/AdelaiDepth/issues/44#issuecomment-1188822214. It will be fixed later, thank you!

lw0210 commented 2 years ago

Thank you! I can run the test_depth.py by loading the self-trained checkpoint and get depth map.But how can I run the test_shape.py?The 'shift_model' and 'focal_model' are still missing.How can I modify my code? @guangkaixu

guangkaixu commented 2 years ago

The code for 'shift_model' and 'focal_model' have not been released yet. We will consider reorganizing and releasing it but it will be time-spending. Thanks for your understanding!

lw0210 commented 2 years ago

ok,Thanks!