NVIDIA Jetson Nano & Jetson inference – PART2 (Classification Training 2020/2/13)

A. Jetson-Nano에서 Training을 직접 시키는 방법


(에러발생) same error (ir_version diff)
위의 이미지는 PT를 1.3으로 설치에서 발생한 오류임

TensorRT 6.1 -> ONNX 0.0.3?
Pytorch 1.3 -> ONNX 0.04? (ONNX_Export.py)

https://github.com/pytorch/pytorch/issues/14946

pytorch >= 1.0 export onnx opset version 9
but tensorrt >= 5.1 support opset version 7

(에러해결) 중요포인트 :
Note that the torch version should be reported as 1.1.0 and the torchvision version should be 0.3.0.

mikado2@mikado2-desktop:~/github/jetson-inference/python/training/classification$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>import torch
>>print(torch.version)
1.1.0
>>import torchvision
>>print(torchvision.version)
0.3.0


Pytorch는 1.1로 설치를 권고하고 있고, 이대로 수행하면 문제 없음

(트레이닝) 트레이닝에 35회 4시간정도 소요됨.

validation set is used to evaluate classification accuracy during training, test images are to be used by us after training completes
The network is never directly trained on the validation and test sets, only the training set.
~/datasets/cat_dog/train/cat 2500개 파일
dog 2500개 파일
/test/cat 100개 파일
/dog 100개 파일
/val/cat 500개 파일
/dog 500개 파일

~/datasets/cat_dog/labels.txt (내용은 cat dog)


Running the Live Camera Program

https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-cat-dog.md#running-the-live-camera-program

DATASET=~/datasets/cat_dog

# C++
imagenet-camera --model=cat_dog/resnet18.onnx --input_blob=input_0 --output_blob=output_0 --labels=$DATASET/labels.txt

# Python
imagenet-camera.py --model=cat_dog/resnet18.onnx --input_blob=input_0 --output_blob=output_0 --labels=$DATASET/labels.txt

Leave a Reply

Your email address will not be published. Required fields are marked *