-
Notifications
You must be signed in to change notification settings - Fork 1
/
train script
51 lines (25 loc) · 2.28 KB
/
train script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
commands to run:
0. set ssd_inception_v2_coco.config with proper num of classes , training and eval directory.
remove checkpoint if required
1.train:
python3 train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_inception_v2_coco.config
2.Save model:
delete existing saved model and check checkpoint argument
python3 export_inference_graph.py --input_type image_tensor --pipeline_config_path ./ssd_inception_v2_coco.config --trained_checkpoint_prefix ./model.ckpt-4943 --output_directory ./fine_tuned_model
3.convert to tfjs:
pip3 install tensorflowjs==0.8.6
tensorflowjs_converter --input_format=tf_saved_model --output_json=true --output_node_names='Postprocessor/ExpandDims_1,Postprocessor/Slice' --output_format=tensorflowjs --saved_model_tags=serve saved_model web_model
shuf -zn30 -e *.tfrecord | xargs -0 cp -vt ~/Desktop/bucket1
tips:
pip uninstall tensorflow
After that check one more time you have tensorflow in your pc or not, calling
pip list | grep tensorflow
you can have another tensorflow after removing the previous one, that's why make sure you removed tensorflow package completely. After removing it, install tensorflow-gpu one more time (I recommend you to use --upgrade flag as well to upgrade all dependencies).
pip install tensorflow-gpu --upgrade
tensorflowjs_converter --input_format=tf_saved_model \ --output_format=tfjs_graph_model \ --saved_model_tags=damage \ --output_node_names='detection_boxes,detection_scores,num_detections,detection_classes' \ fine_tuned_model/saved_model fine_tuned_model/web_model
tensorflowjs_converter --input_format=tf_saved_model \ --output_format=tensorflowjs \ --saved_model_tags=serve \ --output_node_names='detection_boxes,detection_scores,num_detections,detection_classes' \ saved_model/ web_model --output_json=true
tensorflowjs_converter --input_format=tf_saved_model --output_json=true --output_node_names='detection_boxes,detection_multiclass_scores,raw_detection_boxes,detection_scores,num_detections,detection_classes' --output_format=tensorflowjs --saved_model_tags=serve saved_model web_model
PATH_TO_PYTHON=/usr/bin/python3.5
virtualenv -p $PATH_TO_PYTHON my_tutorial_env
source my_tutorial_env/bin/activate # this activates your new environment
pip install tensorflow==1.1