0

Am kind of new to mxnet and I wanted to ask if I can execute a command to train my already trained model with a custom dataset. The first time I trained my model is i.e. with only one class ['dog'] then after I trained the model, I want to train it again with a new class of 'cat' so it will be like ['dog', 'cat']. Is this possible? Thanks in advance.

shaolin30
  • 1
  • 1
  • yes u can definitely train your model on as many classes you want....the only condition is your custom dataset should have data labelled with classes you want to train on....for example, if you want to train on ['dog', 'cats'] then your data should have images of both cats and dogs – coderina Feb 01 '21 at 06:29
  • hello @coderina. Thank you for your response. So, meaning my train.txt will be a list of dog and cat? not cat only? – shaolin30 Feb 02 '21 at 01:09
  • Right now this is the command I am excuting: python3 train_ssd_custom.py --batch-size 2 --epochs 1000000 --model-name ssd --dataset custom --data-shape 300 --dataset-root ~/Dataset/ --dataset-name 2025 --gpus 0 --save-interval 500 --resume ssd_300_vgg16_atrous_custom_1000_0.7336.params. And this is the python class I've used to train my model: https://gist.github.com/androuino/151a76243fe362e3b80b0b2417770c48 – shaolin30 Feb 02 '21 at 01:17
  • Yes , your train.txt should contain cat and dogs and make sure to change the TARGET_CLASSES = ['dog', 'cat'] in the python code. The only thing that u need to make sure how the dataset is saved...e.g. sometimes the there will be folders of classes like 'dog' folder containing dog images or 'cat' folder containing cat images.... Just see how the directory of training dataset is to be made.... – coderina Feb 02 '21 at 04:06
  • Hello @coderina, I have tried what you suggested and I combined the dog and cat dataset to my train.txt as well as the images and xml annotations. However, I am getting an error that says: Failed loading Parameter 'ssd1_ssd1_convpredictor0_conv0_weight' from saved params: shape incompatible expected (12, 512, 3, 3) vs saved (8, 512, 3, 3). Do you have any idea somehow why am getting this? Thanks in advance. – shaolin30 Feb 02 '21 at 05:50
  • I think this https://github.com/dmlc/gluon-cv/issues/243 can work for you...please have a look at it – coderina Feb 02 '21 at 07:17

0 Answers0