Teoge / DMPR-PS

DMPR-PS: A Novel Approach for Parking-Slot Detection Using Directional Marking-Point Regression
GNU General Public License v3.0
198 stars 46 forks source link

Exception in train.py - Can't pickle local object 'train_detector.<locals>.<lambda> #17

Open johannesTech opened 2 years ago

johannesTech commented 2 years ago

Hello @Teoge, first of all, thank you for sharing your research together with your code here!

I tried to execute your code and the inference ran flawlessly. Unfortunately, the training is not running due to the following error at location https://github.com/Teoge/DMPR-PS/blob/88b77e3c3c7e3c14b58db29e4810bc586d0a6896/train.py#L73-L79 Exception has occurred: AttributeError Can't pickle local object 'train_detector.<locals>.<lambda>' This issue is seems to be a result of the lambda function being called in the DataLoader.

I executed your code with python 3.7.0 and torch 1.7.0.

I would appreciate any hint you have for me :)

Best, Johannes

Teoge commented 2 years ago

Did you run your training on windows? It looks similar to this issue. You can try the solutions inside, replacing lambda with a normally defined function, or setting num_workers to 0.