I am trying to train an object detector using TensorFlow following the following tutorial: https://cloud.google.com/blog/products/gcp/training-an-object-detector-using-cloud-machine-learning-engine
The tutorial asks to use object_detection.train
, however this has been moved to legacy so I've used object_detection.model_main
instead. Line 21 of this python file calls the module absl
, however this causes the following error (from the GCP Logs Viewer).
Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/root/.local/lib/python2.7/site-packages/object_detection/model_main.py", line 21, in from absl import flags ImportError: No module named absl
I tried to include absl>=0.1
in the required packages section of the setup.py
file for the object_detection package but that didn't work. Next I tried to move my absl folder into the models/research/object_detection
directory before packaging and starting the job, but that didn't work either. How do I fix this? I'm very new to Tensorflow and the GCP platform so your help will be appreciated. Thanks.
flags
throughtf.app.flags
without the absl package. If you replace each occurrence offlags
(lowercase) withtf.app.flags
, remove the absl import, and remove the lines containingflags.mark_flag_as_required
, will the application work? – MatthewScarpinoREQUIRED_PACKAGES
list in setup.py is'absl-py>=0.1.0'
. Apart from that, download this package tar.gz file tomodels/research/dist
. Install by runningpip install absl-py
. Then, when starting the job adddist/avsl-0.4.0.tar.gz
to the variables passed to the--packages
flag. – Philipp Sh