AdelaiDepth icon indicating copy to clipboard operation
AdelaiDepth copied to clipboard

RuntimeError: stack expects a non-empty TensorList

Open lw0210 opened this issue 2 years ago • 4 comments

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?

lw0210 avatar Aug 02 '22 13:08 lw0210

@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.

guangkaixu avatar Aug 04 '22 06:08 guangkaixu

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/multi_dataset.py", line 79, in __ getitem__ data = self.online_ aug(anno_index) File "/home/liwei/paper31/AdelaiDepth/LeReS/Train/data/multi_dataset.py", line 114, in online_ aug rgb = cv2.imread(rgb_path)[:, :, ::-1]# rgb, HWC TypeError: 'NoneType' object is not subscriptable

lw0210 avatar Aug 05 '22 13:08 lw0210

@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.

guangkaixu avatar Aug 07 '22 05:08 guangkaixu

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

lw0210 avatar Aug 12 '22 09:08 lw0210

@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.

guangkaixu avatar Aug 16 '22 11:08 guangkaixu

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

lw0210 avatar Aug 23 '22 10:08 lw0210

@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!

guangkaixu avatar Aug 31 '22 12:08 guangkaixu

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

lw0210 avatar Aug 31 '22 14:08 lw0210

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!

guangkaixu avatar Sep 04 '22 02:09 guangkaixu

ok,Thanks!

lw0210 avatar Sep 04 '22 02:09 lw0210