PATH_TO_BE_CONFIGURED
What is PATH_TO_BE_CONFIGURED in the following command:
sed -i "s|PATH_TO_BE_CONFIGURED|"${YOUR_GCS_BUCKET}"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
In the tutorial at the address:
https://cloud.google.com/blog/big-data/2017/06/training-an-object-detector-using-cloud-machine-learning-engine
The PATH_TO_BE_CONFIGURED strings need to be changed so they point to the dataset files and fine-tune checkpoint you’ve uploaded to your Cloud Storage bucket.
So, it is my local machine or my bucket:
sed -i "s|/home/alicedinh/models/research/pet_train.record|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
OR
sed -i "s|gs://alicedinh/data/pet_train.record|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
If you're following the cloud tutorial, use the GCS bucket:
sed -i "s|gs://alicedinh/data/pet_train.record|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
@derekjchow
Do I need to modify the faster_rcnn_resnet101_pets.config file? I reckon that I have to coz if I don't put the absolute path to replace PATH_TO_BE_CONFIGURED in this file, the training fail with error:
NotFoundError: PATH_TO_BE_CONFIGURED/pet_label_map.pbtxt
Then, as your suggestion, I did the following command:
sed -i "s|gs://alicedinh/data/pet_train.record|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
sed -i "s|gs://alicedinh/data/pet_val.record|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
sed -i "s|gs://alicedinh/data/pet_label_map.pbtxt|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
sed -i "s|gs://alicedinh/data/model.ckpt.meta|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
sed -i "s|gs://alicedinh/data/model.ckpt.index|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
sed -i "s|gs://alicedinh/data/model.ckpt.data-00000-of-00001|"gs://alicedinh"/data|g" object_detection/samples/configs/faster_rcnn_resnet101_pets.config
then I upload the faster_rcnn_resnet101_pets.config file to my bucket - the one I modified PATH_TO_BE_CONFIGURED by this command:
gsutil cp object_detection/samples/configs/faster_rcnn_resnet101_pets.config gs://alicedinh/data/faster_rcnn_resnet101_pets.config
Then, I run this command to train:
gcloud beta ml-engine jobs submit training `whoami`_object_detection_`date +%s` \
--job-dir=gs://alicedinh/train \
--packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz \
--module-name object_detection.train \
--runtime-version 1.2 \
--region us-central1 \
--config object_detection/samples/cloud/cloud.yml \
-- \
--train_dir=gs://alicedinh/train \
--pipeline_config_path=gs://alicedinh/data/faster_rcnn_resnet101_pets.config
I met the following error:
AttributeError: 'module' object has no attribute 'data'
Please help
Please share the full AttributeError
@derekjchow Here is the full log:
alicedinh_object_detection_1525751468
Failed (6 min 43 sec)
Creation time: 8 May 2018, 10:51:20
Start time: 8 May 2018, 10:57:33
End time: 8 May 2018, 10:58:03
Consumed ML units: 2.76
Error message
The replica master 0 exited with a non-zero status of 1.
Termination reason: Error. Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, 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/train.py", line 167, in <module> tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir)
File "/root/.local/lib/python2.7/site-packages/object_detection/trainer.py", line 264, in train train_config.prefetch_queue_capacity, data_augmentation_options)
File "/root/.local/lib/python2.7/site-packages/object_detection/trainer.py", line 59, in create_input_queue tensor_dict = create_tensor_dict_fn()
File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 120, in get_next dataset_builder.build(config)).get_next()
File "/root/.local/lib/python2.7/site-packages/object_detection/builders/dataset_builder.py", line 164, in build functools.partial(tf.data.TFRecordDataset, buffer_size=8 * 1000 * 1000),
AttributeError: 'module' object has no attribute 'data'
The replica worker 0 exited with a non-zero status of 1.
Termination reason: Error. Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, 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/train.py", line 167, in <module> tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir)
File "/root/.local/lib/python2.7/site-packages/object_detection/trainer.py", line 264, in train train_config.prefetch_queue_capacity, data_augmentation_options)
File "/root/.local/lib/python2.7/site-packages/object_detection/trainer.py", line 59, in create_input_queue tensor_dict = create_tensor_dict_fn()
File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 120, in get_next dataset_builder.build(config)).get_next()
File "/root/.local/lib/python2.7/site-packages/object_detection/builders/dataset_builder.py", line 164, in build functools.partial(tf.data.TFRecordDataset, buffer_size=8 * 1000 * 1000),
AttributeError: 'module' object has no attribute 'data'
To find out more about why your job exited please check the logs: https://console.cloud.google.com/logs/viewer?project=171749705993&resource=ml_job%2Fjob_id%2Falicedinh_object_detection_1525751468&advancedFilter=resource.type%3D%22ml_job%22%0Aresource.labels.job_id%3D%22alicedinh_object_detection_1525751468%22
Training input
{
"scaleTier": "CUSTOM",
"masterType": "standard_gpu",
"workerType": "standard_gpu",
"parameterServerType": "standard",
"workerCount": "5",
"parameterServerCount": "3",
"packageUris": [
"gs://alicedinh/train/packages/e0151f1e1c5c027709422ec1f5954b3ccd4bdaee5c747dbf63007d22cad04d7f/object_detection-0.1.tar.gz",
"gs://alicedinh/train/packages/e0151f1e1c5c027709422ec1f5954b3ccd4bdaee5c747dbf63007d22cad04d7f/slim-0.1.tar.gz"
],
"pythonModule": "object_detection.train",
"args": [
"--train_dir=gs://alicedinh/train",
"--pipeline_config_path=gs://alicedinh/data/faster_rcnn_resnet101_pets.config"
],
"region": "us-central1",
"runtimeVersion": "1.2",
"jobDir": "gs://alicedinh/train"
}
Training output
{
"consumedMLUnits": 2.76
}
I had exactly the same problem and couldn't figure it out. I have tried using both python 2.7 and python 3.6.5 but still getting the same error message. Please let me know if you have overcome the issue.
I'm coming from running_on_mobile_tensorflowlite doc and I can't figure out the details.
Would be useful to have some description about those variables and where they come from. To me as I'm far from the field it's not obvious, but I'm willing to build apps with it.
Thanks!
Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.