fabvio / ld-lsi

Deep learning based lane/freespace detector embedded in ROS node (built for UC3M LSI)
89 stars 18 forks source link

when i run the code an error has occurred:size mismatch #10

Closed lishiyuhebei closed 4 years ago

lishiyuhebei commented 4 years ago

I have downloaded the model, and there is an error when executing the code. The print message is : File "/home/od/ld-lsi/scripts/erfnet_road.py", line 126, in forward output_road = self.road_linear_1(output_road) RuntimeError: size mismatch, m1: [1 x 10240], m2: [7680 x 1024] at /opt/conda/conda-bld/pytorch_1556653215914/work/aten/src/THC/generic/THCTensorMathBlas.cu:268

. If I change the 98th line of erfnet_road.py: change “self.road_linear_1 = nn.Linear(512 3 5, 1024)” to "self.road_linear_1 = nn.Linear(512 4 5, 1024)" in class Encoder(nn.Module), the program will execute normally. How to explain this situation? Am I right? Thanks!

fabvio commented 4 years ago

What size are your input images?

lishiyuhebei commented 4 years ago

The input image size is (640,480)

fabvio commented 4 years ago

Resize input at (640,360) :)

lishiyuhebei commented 4 years ago

Thank you! It works correctly .