automl icon indicating copy to clipboard operation
automl copied to clipboard

Running Step 3 from README.md fails

Open awlego opened this issue 4 years ago • 0 comments

Steps to reproduce:

  1. Clone this repository
  2. Install requirements:
cd efficientdet 
pip install --upgrade pip
pip install numpy 
pip install -r requirements.txt
  1. Download Pretrained EfficientDet Checkpoints provided in Step 2 of the README.md. I am using efficientdet-d0
  2. make a voc_config.yaml file with this inside:
num_classes: 20
moving_average_decay: 0
  1. Try running example as provided in step 3 of the README.md: Template:
!rm  -rf savedmodeldir
!python model_inspect.py --runmode=saved_model --model_name=efficientdet-d0 \
  --ckpt_path=efficientdet-d0 --saved_model_dir=savedmodeldir \
  --tensorrt=FP32  --tflite_path=efficientdet-d0.tflite \
  --hparams=voc_config.yaml

My personal example:

rm  -rf savedmodeldir 
python model_inspect.py --runmode=saved_model --model_name=efficientdet-d0 \
  --ckpt_path='/opt/kuna/models/pretrained/efficientdet-d0'  --saved_model_dir=savedmodeldir \
  --tflite_path=efficientdet-d0.tflite \
  --hparams=voc_config.yaml

This step errors with a dimensions mismatch:

tensorflow.lite.python.convert.ConverterError: Dimensions must be equal, but are 49104 and 220968 for '{{node NonMaxSuppressionV5}} = NonMaxSuppressionV5[T=DT_FLOAT, pad_to_max_output_size=true](strided_slice_18, strided_slice_19, NonMaxSuppressionV5/max_output_size, NonMaxSuppressionV5/iou_threshold, NonMaxSuppressionV5/score_threshold, NonMaxSuppressionV5/soft_nms_sigma)' with input shapes: [49104,4], [220968], [], [], [], []./home/kuna/alex/repositories/automl/env3.8/lib/python3.8/site-packages/tensorflow/python/saved_model/loader_impl.py:302:0: error: 

Any ideas on how to solve this? I've tried several different models and keep running into dimension errors.

I've validated that tensorflow is newer than 2.3.0-dev20200521 per the comment about tflite_path only working after that.

Results of my pip-freeze:

absl-py==0.12.0
astunparse==1.6.3
attrs==21.2.0
cachetools==4.2.2
certifi==2020.12.5
chardet==4.0.0
cycler==0.10.0
Cython==0.29.23
dm-tree==0.1.6
flatbuffers==1.12
gast==0.4.0
google-auth==1.30.1
google-auth-oauthlib==0.4.4
google-pasta==0.2.0
grpcio==1.34.1
h5py==3.1.0
idna==2.10
keras-nightly==2.5.0.dev2021032900
Keras-Preprocessing==1.1.2
kiwisolver==1.3.1
lxml==4.6.3
Markdown==3.3.4
matplotlib==3.4.2
neural-structured-learning==1.3.1
numpy==1.19.5
oauthlib==3.1.0
opt-einsum==3.3.0
Pillow==8.2.0
protobuf==3.17.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycocotools==2.0
pyparsing==2.4.7
python-dateutil==2.8.1
PyYAML==5.4.1
requests==2.25.1
requests-oauthlib==1.3.0
rsa==4.7.2
scipy==1.6.3
six==1.15.0
tensorboard==2.5.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
tensorflow==2.5.0
tensorflow-addons==0.13.0
tensorflow-estimator==2.5.0
tensorflow-hub==0.12.0
tensorflow-model-optimization==0.5.0
termcolor==1.1.0
typeguard==2.12.0
typing-extensions==3.7.4.3
urllib3==1.26.5
Werkzeug==2.0.1
wrapt==1.12.1

awlego avatar Jun 14 '21 19:06 awlego