liuruijin17 / LSTR

This is an official repository of End-to-end Lane Shape Prediction with Transformers.
BSD 3-Clause "New" or "Revised" License
644 stars 130 forks source link

train error happens when I train my own data use the custom branch #67

Closed lvxuanxuan123 closed 2 years ago

lvxuanxuan123 commented 2 years ago

Traceback (most recent call last): File "/home/anaconda3/envs/lstr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/home/anaconda3/envs/lstr/lib/python3.6/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "train.py", line 54, in prefetch_data raise e File "train.py", line 50, in prefetch_data data, ind = sample_data(db, ind) File "/home/LSTR/LSTR-custom/sample/custom.py", line 71, in sample_data return globals()[system_configs.sampling_function](db, k_ind) File "/home/LSTR/LSTR-custom/sample/custom.py", line 31, in kp_detection mask = np.ones((1, img.shape[0], img.shape[1], 1), dtype=np.bool) AttributeError: 'NoneType' object has no attribute 'shape'

liuruijin17 commented 2 years ago

Hi, It happens when the image is not loaded correctly. Please check out the path you pass to cv2.imread at https://github.com/liuruijin17/LSTR/blob/7e4e4f1ad5844be492007cf89e81e574c764d307/sample/custom.py#L30

lvxuanxuan123 commented 2 years ago

Hi, It happens when the image is not loaded correctly. Please check out the path you pass to cv2.imread at

https://github.com/liuruijin17/LSTR/blob/7e4e4f1ad5844be492007cf89e81e574c764d307/sample/custom.py#L30

hello, I know the problem is in this line, but the print path shows that it seems to be fine. My dataset is stored in raws. And the error still exists. 屏幕截图

lvxuanxuan123 commented 2 years ago

@liuruijin17 Dear author, I solved this problem by converting the image format from .png to .jpg.

AvneeshKhanna commented 2 years ago

Hi I have the same issue. My files are in jpg only. But I am still getting the error

lvxuanxuan123 commented 2 years ago

Hi I have the same issue. My files are in jpg only. But I am still getting the error

You can print the path as what I did.