Problem with the python train.py command from "Hello AI World"

Hey guys,

when i try to retrain a given model with the instructions from here (python train.py is the command) I get an error message that tells me that “torch” module is missing and cannot be included.

After a quick search I found a guide to installing pytorch on a jetson, which seemed to work until I wanted to build the dependencies with “python setup.py build deps”. Here I get an error message that says something like “Syntax error in line 227 of setup.py” (said line says:“print(*args)”).

My python version is 3.5.2 and I’m using a Jetson TX2 with Jetpack 3.2.1. and Ubuntu 16.04

Ps: could anyone tell me if i can retrain a network with my dataset being on an external flashdrive that is connected to the Jetson (there is not enough diskspace on it for all my pictures)

Thanks in advance to everyone :)

Hi @michaelmueller1994, if you are on JetPack 4.2 or newer, Hello AI World will automatically install PyTorch for you like here. However since you are on JetPack 3.2.1, as you pointed out you would need to compile it from source (or ideally reflash your JetPack to the latest version, since JetPack 3.2.1 is older at this point).

I don’t recall building PyTorch from source with Python 3.5, only Python 2.7 and 3.6. Is the syntax error perhaps related to Python version? You also might want to try cloning an older branch of PyTorch rather than master (like is done in the script). In reality, I recommend just updating your version of JetPack (i.e. to JetPack 4.4) where pre-compiled PyTorch wheels and containers are already available.

When you run train.py it expects the path to your dataset. So if that path is on your external drive, it will read the dataset from your external drive.

1 Like

Thank you very much for the answer, i guess i will try updating to a newer JetPack version then.