tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.55k stars 3.5k forks source link

Using Google Cloud Storage (gs://) paths fails #879

Open activatedgeek opened 6 years ago

activatedgeek commented 6 years ago

Description

Using Google Cloud Storage for --data_dir fails. Using gs paths like gs://my-bucket/path/to/folder fails.

NOTE: This is most likely a Tensorflow bug than Tensor2Tensor bug but keeping it here for the record. ...

Environment information

OS: macOS 10.12

$ pip freeze | grep tensor
tensor2tensor==1.6.3
tensorboard==1.8.0
tensorflow==1.8.0

$ python -V
Python 3.6.5

For bugs: reproduction and error logs

# Steps to reproduce:
t2t-datagen --tmp_dir=/tmp --problem=translate_ende_wmt32k --data_dir=gs://my_bucket/path
# Error logs:
Traceback (most recent call last):
  File "/.virtualenvs/env3/bin/t2t-datagen", line 27, in <module>
    tf.app.run()
  File "/.virtualenvs/env3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "/.virtualenvs/env3/bin/t2t-datagen", line 23, in main
    t2t_datagen.main(argv)
  File "/.virtualenvs/env3/lib/python3.6/site-packages/tensor2tensor/bin/t2t_datagen.py", line 171, in main
    tf.gfile.MakeDirs(FLAGS.data_dir)
  File "/.virtualenvs/env3/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 374, in recursive_create_dir
    pywrap_tensorflow.RecursivelyCreateDir(compat.as_bytes(dirname), status)
  File "/.virtualenvs/env3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: 'object' must be a non-empty string. (File: gs://my_bucket/)

Fixes/Hacks

Not recommended but a good enough to isolate the cause.

The error comes from the pywrap_tensorflow binary and cannot be debugged further without going into Tensorflow source I believe.

activatedgeek commented 6 years ago

/cc @lukaszkaiser

activatedgeek commented 6 years ago

This also doesn't work with TensorFlow 1.7.0.