automl
automl copied to clipboard
efficientnetV2 | AttributeError: '_UserObject' object has no attribute 'cfg'
Hi,
I tried to run python3 infer.py --mode tf2bm --model_name efficientnetv2-s --model_dir ../../efficientnetv2-s/ --export_dir ../../efficientnetv2-s/saved_model with pretrained models and got the following errors:
Traceback (most recent call last):
File "infer.py", line 205, in <module>
app.run(main)
File "/home/shuyuel/.cache/turtle/test_venv/lib/python3.8/site-packages/absl/app.py", line 312, in run
_run_main(main, args)
File "/home/shuyuel/.cache/turtle/test_venv/lib/python3.8/site-packages/absl/app.py", line 258, in _run_main
sys.exit(main(argv))
File "infer.py", line 195, in main
tf2_benchmark()
File "infer.py", line 100, in tf2_benchmark
if model.cfg.model.data_format == 'channels_first':
AttributeError: '_UserObject' object has no attribute 'cfg'
Here are the reproducing steps:
- Set up TF2.5 along with other required dependencies.
- get efficientnetv2-s ckpt from
wget https://storage.googleapis.com/cloud-tpu-checkpoints/efficientnet/v2/efficientnetv2-s.tgz git clone https://github.com/google/automl- cd /path/to/automl/efficientnetv2
python3 infer.py \
--mode tf2bm \
--model_name efficientnetv2-s \
--model_dir ../../efficientnetv2-s/ \
--export_dir ../../efficientnetv2-s/saved_model
Looks like the regression is due to the recent change in automl about channels_first. After reverting this change, the case could proceed.
commit 5b2b61005c54efe72f97cf7d0e924afed6a62a60 (HEAD -> master, origin/master, origin/HEAD)
Author: Mingxing Tan <[email protected]>
Date: Mon Jul 11 10:18:52 2022 -0700
Add support for channels_first.
Fix #1162