AK51
July 6, 2022, 8:10am
1
Hi,
I am using dusty-nv inference.
I can do the object detection retrain by calling
-pretrained-ssd= xxx.pth
However, when I try to retrain the classification,
I do not see any pth file, just two compressed files.
checkpoint.pth.tar
model_best.pth.tar
I did unzip them but still cannot find the pth.
May I know the proper way to retain the model?
Thx
Hi,
Do you apply the classification retraining with the similar procedure as below:
<img src="https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/deep-vision-header.jpg" width="100%">
<p align="right"><sup><a href="pytorch-transfer-learning.md">Back</a> | <a href="pytorch-plants.md">Next</a> | </sup><a href="../README.md#hello-ai-world"><sup>Contents</sup></a>
<br/>
<sup>Transfer Learning - Classification</sup></s></p>
# Re-training on the Cat/Dog Dataset
The first model that we'll be re-training is a simple model that recognizes two classes: cat or dog.
<img src="https://github.com/dusty-nv/jetson-inference/raw/python/docs/images/pytorch-cat-dog.jpg" width="700">
Provided below is an 800MB dataset that includes 5000 training images, 1000 validation images, and 200 test images, each evenly split between the cat and dog classes. The set of training images is used for transfer learning, while the validation set is used to evaluate classification accuracy during training, and the 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.
The images from the dataset are made up of many different breeds of dogs and cats, including large felines like tigers and mountain lions since the amount of cat images available was a bit lower than dogs. Some of the images also picture humans, which the detector is essentially trained to ignore as background and focus on the cat vs. dog content.
To get started, first make sure that you have [PyTorch installed](pytorch-transfer-learning.md#installing-pytorch) on your Jetson, then download the dataset below and kick off the training script. After that, we'll test the re-trained model in TensorRT on some static images and a live camera feed.
## Downloading the Data
During this tutorial, we'll store the datasets on the host device under `jetson-inference/python/training/classification/data`, which is one of the directories that is automatically [mounted into the container](aux-docker.md#mounted-data-volumes). This way the dataset won't be lost when you shutdown the container.
This file has been truncated. show original
Thanks.
AK51
July 21, 2022, 6:24am
5
Hi,
Yes, I create my own dataset for classification. Training from the beginning is ok.
I just don’t know how to continue the training based on my trained model yesterday for example.
Thx
Hi,
You can find some information below for training on a custom database:
<img src="https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/deep-vision-header.jpg" width="100%">
<p align="right"><sup><a href="pytorch-plants.md">Back</a> | <a href="pytorch-ssd.md">Next</a> | </sup><a href="../README.md#hello-ai-world"><sup>Contents</sup></a>
<br/>
<sup>Transfer Learning - Classification</sup></s></p>
# Collecting your own Classification Datasets
In order to collect your own datasets for training customized models to classify objects or scenes of your choosing, we've created an easy-to-use tool called `camera-capture` for capturing and labeling images on your Jetson from live video:
<img src="https://github.com/dusty-nv/jetson-inference/raw/python/docs/images/pytorch-collection.jpg" >
The tool will create datasets with the following directory structure on disk:
```
‣ train/
• class-A/
• class-B/
• ...
‣ val/
• class-A/
This file has been truncated. show original
Thanks.
AK51
July 29, 2022, 5:40am
7
ok ok, I can use resume option, thx
If you need to, go back and collect more data and re-train your model again. You can restart the training from where you left off using the `--resume` and `--epoch-start` flags (run `python3 train.py --help` for more info). Then remember to re-export the model.
$ cd jetson-inference/python/training/classification
$ python3 train.py --model-dir=models/ data/ --resume
system
Closed
August 12, 2022, 5:40am
8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.