Open Digital2Slave opened 5 years ago
@JohnTian Hi,
@AlexeyAB Thanks for your reply.
I only change the way to pass .cfg, .weights, *.data and test image in main function
if __name__ == "__main__":
cfgPath = sys.argv[1]
weightsPath = sys.argv[2]
dataPath = sys.argv[3]
imagePath = sys.argv[4]
res = performDetect(
imagePath=imagePath,
thresh=0.25,
configPath=cfgPath,
weightPath=weightsPath,
metaPath=dataPath,
showImage=False)
classes = set([r[0] for r in res])
print(classes)
➜ epbox_tiny_mobile git:(master) python tf_models/pddvsm/pddvsm.py \
tf_models/pddvsm/pddvsm_resnet50_yolo_recall.cfg \
tf_models/pddvsm/pddvsm_resnet50_yolo_final.weights \
tf_models/pddvsm/pddvsm.data \
/mnt/images/epbox/92902000094/2019-01-18/M9290200009490118020/M9290200009490118020_0_crop.jpg
5
➜ epbox_tiny_mobile git:(master) python tf_models/pddvsm/pddvsm.py \
tf_models/pddvsm/pddvsm_resnet50_yolo_recall.cfg \
tf_models/pddvsm/pddvsm_resnet50_yolo_final.weights \
tf_models/pddvsm/pddvsm.data \
/mnt/images/epbox/92902000094/2019-01-18/M9290200009490118020/M9290200009490118020_0_crop.jpg
1
Finally, after retrain the model by adding new labelled images. This weird phenomena disappeared! By now, for the same test image, this model always produce '5'.
➜ epbox_tiny_mobile git:(master) python tf_models/pddvsm/pddvsm.py \
tf_models/pddvsm/pddvsm_resnet50_yolo_recall.cfg \
tf_models/pddvsm/pddvsm_resnet50_yolo_final.weights \
tf_models/pddvsm/pddvsm.data \
/mnt/images/epbox/92902000094/2019-01-18/M9290200009490118020/M9290200009490118020_0_crop.jpg
5
@JohnTian Hello! Would it be possible for you to share your darknet.py? I just want to test it out because the one included in the zip file does not work for me.
@OndoyManing darknet.py Be sure, your darknet.so is generated correct.
I had a similar issue, though I posted it on the pjreddie page: https://github.com/pjreddie/darknet/issues/1547
I trained an objects detect model based on resnet50 in Ubuntu 16.04 LTS by refer 432 . But, when i test the model with
darknet.py
on command line. I got different results with the same*.cfg, *.weights, *.data
and test image.For example: By use
python darknet.py
with the*.cfg, *.weights, *.data
and test image. I got the result label 5. But, by usepython darknet.py
with the same*.cfg, *.weights, *.data
and test image many times, I finally got the result label 1.This is weird. All the command lines run in normal user. I don't know why, anyone could help me out? Thanks a lot. @AlexeyAB