Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inputs[key] = ipt.to(self.device),AttributeError: 'NoneType' object has no attribute 'to'` #22

Closed
AZong76 opened this issue Apr 22, 2023 · 2 comments

Comments

@AZong76
Copy link

AZong76 commented Apr 22, 2023

Hello, we attempted to run Lite mono's training, and we prepared the kitti dataset and successfully loaded it. However, while training, we encountered the following problem:

`(dh_robodepth) lyu4@lyu4:~/dh_wp/Lite-Mono-main$ CUDA_VISIBLE_DEVICES=1 python train.py
Training model named:
mymono
Models and tensorboard events files are saved to:
./tmp
Training is using:
cuda
/home/lyu4/anaconda3/envs/dh_robodepth/lib/python3.10/site-packages/torchvision/transforms/transforms.py:332: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.
warnings.warn(
Using split:
eigen_zhou
There are 39810 training items and 4424 validation items

Training
Traceback (most recent call last):
File "/home/lyu4/dh_wp/Lite-Mono-main/train.py", line 12, in
trainer.train()
File "/home/lyu4/dh_wp/Lite-Mono-main/trainer.py", line 218, in train
self.run_epoch()
File "/home/lyu4/dh_wp/Lite-Mono-main/trainer.py", line 237, in run_epoch
outputs, losses = self.process_batch(inputs)
File "/home/lyu4/dh_wp/Lite-Mono-main/trainer.py", line 268, in process_batch
inputs[key] = ipt.to(self.device)
AttributeError: 'NoneType' object has no attribute 'to'`

We have tried many methods, but have been stuck here. Can you help me solve this problem? thank

@noahzn
Copy link
Owner

noahzn commented Apr 22, 2023

Hi, it seems that the code didn't load your data successfully. Could you try to check if here the inputs is None?

@AZong76
Copy link
Author

AZong76 commented Apr 22, 2023

Thank you, we have solved this problem

@AZong76 AZong76 closed this as completed Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants