tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Following the object detection tutorial leads to an "illegal operation" error

Open ThierryO opened this issue 1 year ago • 0 comments

Description

I'm following this tutorial. Running ./retrain_detection_model.sh results in an error:

Illegal instruction     python object_detection/model_main.py --pipeline_config_path="${CKPT_DIR}/pipeline.config" --model_dir="${TRAIN_DIR}" --num_train_steps="${num_training_steps}" --num_eval_steps="${num_eval_steps}"
Click to expand!

Issue Type

Bug

Operating System

Linux

Coral Device

M.2 Accelerator B+M

Other Devices

No response

Programming Language

No response

Relevant Log Output

[poortwachter@mystacinus object_detection]$ DETECT_DIR=${PWD}/out && mkdir -p $DETECT_DIR
[poortwachter@mystacinus object_detection]$ docker run --name edgetpu-detect \
> --rm -it --privileged -p 6006:6006 \
> --mount type=bind,src=${DETECT_DIR},dst=/tensorflow/models/research/learn_pet \
> detect-tutorial-tf1

________                               _______________                
___  __/__________________________________  ____/__  /________      __
__  /  _  _ \_  __ \_  ___/  __ \_  ___/_  /_   __  /_  __ \_ | /| / /
_  /   /  __/  / / /(__  )/ /_/ /  /   _  __/   _  / / /_/ /_ |/ |/ / 
/_/    \___//_/ /_//____/ \____//_/    /_/      /_/  \____/____/|__/


WARNING: You are running this container as root, which can cause new files in
mounted volumes to be created as the root user on your host machine.

To avoid this, run the container by specifying your user's userid:

$ docker run -u $(id -u):$(id -g) args...
root@1aeae03169c5:/tensorflow/models/research# ./prepare_checkpoint_and_dataset.sh --network_type mobilenet_v1_ssd --train_whole_model false
+ network_type=mobilenet_v1_ssd
+ train_whole_model=false
+ [[ 4 -gt 0 ]]
+ case "$1" in
+ network_type=mobilenet_v1_ssd
+ shift 2
+ [[ 2 -gt 0 ]]
+ case "$1" in
+ train_whole_model=false
+ shift 2
+ [[ 0 -gt 0 ]]
+ source /tensorflow/models/research/constants.sh
++ declare -A ckpt_link_map
++ declare -A ckpt_name_map
++ declare -A config_filename_map
++ ckpt_link_map["mobilenet_v1_ssd"]=http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz
++ ckpt_link_map["mobilenet_v2_ssd"]=http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03.tar.gz
++ ckpt_name_map["mobilenet_v1_ssd"]=ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18
++ ckpt_name_map["mobilenet_v2_ssd"]=ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03
++ config_filename_map["mobilenet_v1_ssd-true"]=pipeline_mobilenet_v1_ssd_retrain_whole_model.config
++ config_filename_map["mobilenet_v1_ssd-false"]=pipeline_mobilenet_v1_ssd_retrain_last_few_layers.config
++ config_filename_map["mobilenet_v2_ssd-true"]=pipeline_mobilenet_v2_ssd_retrain_whole_model.config
++ config_filename_map["mobilenet_v2_ssd-false"]=pipeline_mobilenet_v2_ssd_retrain_last_few_layers.config
++ INPUT_TENSORS=normalized_input_image_tensor
++ OUTPUT_TENSORS=TFLite_Detection_PostProcess,TFLite_Detection_PostProcess:1,TFLite_Detection_PostProcess:2,TFLite_Detection_PostProcess:3
++ OBJ_DET_DIR=/tensorflow/models/research
++ LEARN_DIR=/tensorflow/models/research/learn_pet
++ DATASET_DIR=/tensorflow/models/research/learn_pet/pet
++ CKPT_DIR=/tensorflow/models/research/learn_pet/ckpt
++ TRAIN_DIR=/tensorflow/models/research/learn_pet/train
++ OUTPUT_DIR=/tensorflow/models/research/learn_pet/models
+ echo 'PREPARING checkpoint...'
PREPARING checkpoint...
+ mkdir -p /tensorflow/models/research/learn_pet
+ ckpt_link=http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz
+ ckpt_name=ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18
+ cd /tensorflow/models/research/learn_pet
+ wget -O ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz
--2024-12-21 11:14:07--  http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz
Resolving download.tensorflow.org (download.tensorflow.org)... 64.233.167.207, 64.233.166.207, 74.125.71.207, ...
Connecting to download.tensorflow.org (download.tensorflow.org)|64.233.167.207|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85682182 (82M) [application/x-tar]
Saving to: ‘ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz’

ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.g 100%[=====================================================================================================================================================>]  81.71M  31.3MB/s    in 2.6s    

2024-12-21 11:14:10 (31.3 MB/s) - ‘ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz’ saved [85682182/85682182]

+ tar zxvf ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz
ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18/pipeline.config
ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18/tflite_graph.pb
ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18/model.ckpt.meta
ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18/
ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18/tflite_graph.pbtxt
ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18/model.ckpt.index
ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18/model.ckpt.data-00000-of-00001
+ mv ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18 /tensorflow/models/research/learn_pet/ckpt
root@1aeae03169c5:/tensorflow/models/research# NUM_TRAINING_STEPS=500 && \
> NUM_EVAL_STEPS=100
root@1aeae03169c5:/tensorflow/models/research# ./retrain_detection_model.sh \
> --num_training_steps ${NUM_TRAINING_STEPS} \
> --num_eval_steps ${NUM_EVAL_STEPS}
+ num_training_steps=500
+ [[ 4 -gt 0 ]]
+ case "$1" in
+ num_training_steps=500
+ shift 2
+ [[ 2 -gt 0 ]]
+ case "$1" in
+ num_eval_steps=100
+ shift 2
+ [[ 0 -gt 0 ]]
+ source /tensorflow/models/research/constants.sh
++ declare -A ckpt_link_map
++ declare -A ckpt_name_map
++ declare -A config_filename_map
++ ckpt_link_map["mobilenet_v1_ssd"]=http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18.tar.gz
++ ckpt_link_map["mobilenet_v2_ssd"]=http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03.tar.gz
++ ckpt_name_map["mobilenet_v1_ssd"]=ssd_mobilenet_v1_quantized_300x300_coco14_sync_2018_07_18
++ ckpt_name_map["mobilenet_v2_ssd"]=ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03
++ config_filename_map["mobilenet_v1_ssd-true"]=pipeline_mobilenet_v1_ssd_retrain_whole_model.config
++ config_filename_map["mobilenet_v1_ssd-false"]=pipeline_mobilenet_v1_ssd_retrain_last_few_layers.config
++ config_filename_map["mobilenet_v2_ssd-true"]=pipeline_mobilenet_v2_ssd_retrain_whole_model.config
++ config_filename_map["mobilenet_v2_ssd-false"]=pipeline_mobilenet_v2_ssd_retrain_last_few_layers.config
++ INPUT_TENSORS=normalized_input_image_tensor
++ OUTPUT_TENSORS=TFLite_Detection_PostProcess,TFLite_Detection_PostProcess:1,TFLite_Detection_PostProcess:2,TFLite_Detection_PostProcess:3
++ OBJ_DET_DIR=/tensorflow/models/research
++ LEARN_DIR=/tensorflow/models/research/learn_pet
++ DATASET_DIR=/tensorflow/models/research/learn_pet/pet
++ CKPT_DIR=/tensorflow/models/research/learn_pet/ckpt
++ TRAIN_DIR=/tensorflow/models/research/learn_pet/train
++ OUTPUT_DIR=/tensorflow/models/research/learn_pet/models
+ mkdir -p /tensorflow/models/research/learn_pet/train
+ python object_detection/model_main.py --pipeline_config_path=/tensorflow/models/research/learn_pet/ckpt/pipeline.config --model_dir=/tensorflow/models/research/learn_pet/train --num_train_steps=500 --num_eval_steps=100
./retrain_detection_model.sh: line 58:    23 Illegal instruction     python object_detection/model_main.py --pipeline_config_path="${CKPT_DIR}/pipeline.config" --model_dir="${TRAIN_DIR}" --num_train_steps="${num_training_steps}" --num_eval_steps="${num_eval_steps}"

ThierryO avatar Dec 21 '24 11:12 ThierryO