Closed abuelgasimsaadeldin closed 2 years ago
I had the same Error and solved it by updating PyTorch to 1.2, but then i can't execute the interavtive_regression anymore.
Hi @TimIWT
Thanks for the reply! So is there any other solution that would allow me to be able to execute both road_following as well as interactive regression? I wouldn't want to downgrade PyTorch every time I would like to run the interactive_regression.ipynb. Thanks. Ps. I check my current version of Pytorch and the result was "1.1.0a0+b457266" not sure exactly what this means but i'm guessing its currently PyTorch 1.1?
Yes it is PyTorch 1.1. I am trying to find a solution at the moment and I will let you know as soon as i find one.
Hi @TimIWT,
Thanks that would be very much appreciated. I will do the same too, as for now I found a temporary solution which is to add: "torch.Tensor.ndim = property(lambda x: len(x.size()))" in the code and that would bypass the error. Still however my road following does not work at all as expected.
What's the problem with the road following notebook? Mine is working but the steering is somehow inverted, so whenever there is a left turn on my track the car goes right.
Hi @TimIWT
Yes that is exactly the problem I am facing now, another problem is once I run the the final codes on road following and the tires start to spin, I am unable to make any changes to the steering_gain, steering bias or even car.throttle and so the robot keeps running until I manually have to shut it down by using sudo command. Do you know of any way to bypass this issue? (by adding sliders etc.) Also how did you manage to solve the direction problem getting it to turn right when it is supposed to and left when it is supposed to instead of the opposite?
Thanks.
About your first problem i am not sure if you can fix it without restarting it (steering_gain and bias seem to be static attributes), but you could use the manual override switch on the RC transmitter to stop the tires as well. I will try to find a solution for the direction problem tomorrow, because i need to wait for the battery to charge now. I thought about checking the steering in the basic_motion notebook again. The problem is most probably software-based because it is working when i use the manual control with the RC transmitter.
Also thanks for your solution for the converting problem!
Hi @TimIWT
Cool! I will try to look for a solution as well. Thanks!
Quick update I found the solution to the problem which was to set the steering_gain to negative value for it to be able to react accordingly.
Hi All,
Thanks for pointing this issue out.
This issue likely surfaced from a change to torch2trt
which references the ndim
attribute. This change was introduced in this commit
https://github.com/NVIDIA-AI-IOT/torch2trt/commit/48eb79e850734ff4af19f19fa8416cf03aacbfaa
If you try the previous commit of torch2trt, that may allow you to user older versions of PyTorch. The previous commit is here
https://github.com/NVIDIA-AI-IOT/torch2trt/commit/3ddd70d7cb7074ed204bd77205ab8f6515e06312
While that may be a workaround, it requires reverting to an older torch2trt.
I'm curious, what was the issue you faced using a later version of PyTorch with the interactive regression notebook?
Best, John
Hi All,
@abuelgasimsaadeldin my JetRacer working now! I use the basic_motion notebook to change the throttle whilst running the final code. Thanks again for helping me out!
@jaybdub the problem with the later version of PyTorch was, that the Kernel was restarting as soon as i started the training progress.
Best regards, Tim
As an update, the following PR was merged to torch2trt which should address the original issue here and enable support for older PyTorch versions.
I am using Jetracer by Waveshare and when implementing the following codes in road_following.ipynb:
from torch2trt import torch2trt
data = torch.zeros((1, 3, 224, 224)).cuda().half()
model_trt = torch2trt(model, [data], fp16_mode=True)
I receive the following error:
AttributeError Traceback (most recent call last)