('setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (4,) + inhomogeneous part.',) when running Mainfile.py
Lvicek07 opened this issue · 10 comments
After running Mainfile.py, I get spammed by this error
Using Python 3.9, torch 1.11.0+cu113, torchaudio 0.11.0+cu113, torchvision 0.12.0+cu113
After some debugging, the error is thrown somewhere from line 525 to 531 in Mainfile.py
Yup this is a known bug, that I have gotten around 5 reports so far from Discord.
Unfortunately I do not yet know what causes this error.
And right now, due to having to study a lot, I do not have time to investigate this.
I will update this issue once I am starting to debug this.
Also just as some extra information, can you provide your gpu name, and you CUDA version.
I see that you are using torch CUDA 1.13 (CUDA 11.3), but did you install CUDA Toolkit 12.0?
Edit : Formatting
I have NVIDIA GTX 1050 and CUDA 11.0, 11.3, 11.7 and 11.8
Hmm ok, I would first suggest removing most of those cuda versions. When you installed the app, did you update your CUDA, all the others were using CUDA 12.0, so that is my current culprit.
When trying experimental branch in Pycharm, I got this Traceback
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\tkinter\__init__.py", line 1921, in __call__
return self.func(*args)
File "C:\Users\MyUser\Desktop\Euro-Truck-Simulator-2-Lane-Assist-experimental\AppUI.py", line 168, in <lambda>
toggleButton = MakeButton(top_left, "Enable", lambda: ToggleEnabled(), 0, 0, style="Accent.TButton")
File "C:\Users\MyUser\Desktop\Euro-Truck-Simulator-2-Lane-Assist-experimental\AppUI.py", line 123, in ToggleEnabled
MainFile.ToggleEnable()
File "C:\Users\MyUser\Desktop\Euro-Truck-Simulator-2-Lane-Assist-experimental\MainFile.py", line 133, in ToggleEnable
LaneDetection.UpdateLanes()
File "C:\Users\MyUser\Desktop\Euro-Truck-Simulator-2-Lane-Assist-experimental\ets2LaneDetection.py", line 269, in UpdateLanes
output_img = lane_detector.detect_lanes(frame, showLanePoints, showLanes, color=laneColor)
File "C:\Users\MyUser\Desktop\Euro-Truck-Simulator-2-Lane-Assist-experimental\ultrafastLaneDetector\ultrafastLaneDetector.py", line 118, in detect_lanes
self.lanes_points, self.lanes_detected = self.process_output(output, self.cfg)
File "C:\Users\MyUser\Desktop\Euro-Truck-Simulator-2-Lane-Assist-experimental\ultrafastLaneDetector\ultrafastLaneDetector.py", line 180, in process_output
return np.array(lanes_points), np.array(lanes_detected)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (4,) + inhomogeneous part.
Then it spammed ('setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (4,) + inhomogeneous part.',)
Hmm, seems that PyCharm gives a little better traceback. Appreciate all the help, I will investigate more when I have the time, this will make it much easier.
The function np.array(lanes_points)
returned the error. Other one is fine
Temporary fix for this is downgrading numpy, I downgraded to numpy 1.21.6 and it now works fine.
Oh wow, I thought it was CUDA messing up. Well anyway thank you so much for taking a look and finding a temporary fix, I will update the app to make sure it downloads the correct version. Still have to find a permanent fix though, can't download an older version infinitely.
No longer an issue in the new version, for now use the anaconda-installer branch to install, tutorial and main coming once I have time.