voldemortX / pytorch-auto-drive

PytorchAutoDrive: Segmentation models (ERFNet, ENet, DeepLab, FCN...) and Lane detection models (SCNN, RESA, LSTR, LaneATT, BézierLaneNet...) based on PyTorch with fast training, visualization, benchmarking & deployment help
BSD 3-Clause "New" or "Revised" License
850 stars 138 forks source link

AttributeError: 'tuple' object has no attribute 'to' #21

Closed hanzhy-code closed 3 years ago

hanzhy-code commented 3 years ago

when I use the argument(val-num-steps), the error occurred(AttributeError: 'tuple' object has no attribute 'to'). The full command is as follow: python main_landec.py --epochs=50 --lr=0.2 --batch-size=4 --dataset=tusimple --method=baseline --backbone=erfnet --mixed-precision --exp-name=111 --val-num-steps=2

I'd like to make sure if it should change 'image_set='val' ' to 'image_set='valfast'' in 178 line in all_utils_landec.py.

voldemortX commented 3 years ago

@hanzhy-code It is indeed a bug, the script is reproduceable. I'll investigate how did this happen.

voldemortX commented 3 years ago

I'd like to make sure if it should change 'image_set='val' ' to 'image_set='valfast'' in 178 line in all_utils_landec.py.

Yes, this should be the right fix. I've updated the code. The reason for this bug is probably because when I differentiated val and valfast, I forgot to change this line of code.

p.s. Thanks a lot for finding this bug!

hanzhy-code commented 3 years ago

@voldemortX Thank you for your reply. Your work is great. I've learned a lot from it

voldemortX commented 3 years ago

You're welcome! I'm closing this issue since the bug is fixed.

A side note, I don't think --val-num-steps=2 is realistic, since it is step, not epoch.

hanzhy-code commented 3 years ago

Yes, I just for testing the code.