Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix torch imports for rpi #1004

Merged
merged 2 commits into from
Mar 31, 2022

Conversation

DocGarbanzo
Copy link
Contributor

@DocGarbanzo DocGarbanzo commented Mar 30, 2022

Fix pytorch import issue created in #986

There is an issue with the RPi version after merging of #986. The pytorch imports are not moved into the corresponding classes / functions, such now pytorch becomes a dependency when running code, like loading a model. This is non-wanted behaviour, because on RPi we don't install pytorch by default, and causes the manage.py drive --model to fail. This fix moves the imports into the relevant classes/functions and fixes the issue.

…to work w/o pytorch installation. This is the default setup on RPi.
@DocGarbanzo DocGarbanzo requested a review from Ezward March 30, 2022 20:56
Copy link
Contributor

@Ezward Ezward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look good.

@francisduvivier
Copy link

Hi, I tried this patch and I can also confirm that this fix is working for me on the raspberry pi 4b with 32 bit buster for driving with my model.

@DocGarbanzo DocGarbanzo merged commit 14db8a8 into autorope:main Mar 31, 2022
DocGarbanzo added a commit that referenced this pull request Mar 31, 2022
* Moving torch imports into functions such that donkeycar can continue to work w/o pytorch installation. This is the default setup on RPi.

* Bumped version

(cherry picked from commit 14db8a8)
@DocGarbanzo DocGarbanzo deleted the fix_torch_imports_for_rpi branch November 29, 2022 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants