Skip to content

Instantly share code, notes, and snippets.

@dgtlmoon
Last active June 29, 2020 19:31
Show Gist options
  • Save dgtlmoon/cd4a0330dff1ff953d7b70a741851423 to your computer and use it in GitHub Desktop.
Save dgtlmoon/cd4a0330dff1ff953d7b70a741851423 to your computer and use it in GitHub Desktop.
deepdetect vgg16 finetune (before simsearch with finetuned weights)
#!/bin/bash
#change base_lr
curl -X DELETE "http://localhost:8080/services/tag_detect_vgg16?clear=all"
sleep 1
docker stop dd_tags
docker rm dd_tags
chmod -R 777 models
nvidia-docker run --name dd_tags -d -p 8080:8080 -v "`pwd`":/tags_dataset jolibrain/deepdetect_gpu
rm models/vgg16/*txt models/vgg16/*json models/vgg16/model* models/vgg16/*proto*
rm -rf models/vgg16/*lmdb
sleep 1
curl -X PUT "http://localhost:8080/services/tag_detect_vgg16" -d '{
"mllib": "caffe",
"description": "tag detector vgg16",
"type": "supervised",
"parameters": {
"input": {
"connector": "image",
"width":224,
"height":224
},
"mllib": {
"finetuning": true,
"nclasses":3,
"weights": "/tags_dataset/models/vgg16/VGG_ILSVRC_16_layers.caffemodel",
"template": "vgg_16",
"finetuning":true
}
},
"model": {
"templates": "../templates/caffe/",
"repository": "/tags_dataset/models/vgg16",
"create_repository": true
}
}'
sleep 2
curl -X POST "http://localhost:8080/train" -d '{
"service": "tag_detect_vgg16",
"async": true,
"parameters": {
"input": {
"shuffle": true,
"db": true,
"connector": "image",
"test_split":0.1,
"shuffle":true,
"width":224,
"height":224
},
"mllib": {
"gpu": true,
"resume": false,
"net": {
"batch_size": 32
},
"solver": {
"iterations": 80000,
"test_interval": 500,
"snapshot": 1000,
"solver_type": "RMSPROP",
"base_lr": 0.001
},
"noise":{"all_effects":true, "prob":0.001},
"distort":{"all_effects":true, "prob":0.01},
"bbox": true
},
"output": {
"measure": [
"map", "map_1", "map_2", "map_3"
]
}
},
"data": [
"/tags_dataset/train.txt",
"/tags_dataset/test.txt"
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment