1

I am trying to use Google Cloud ML Engine to optimize hyperparameters for my variational autoencoder model, but the job fails because the .tfrecord files I specify for my input are not found. In my model code, I pass train.tfrecords to my input tensor as in the canonical cifar10 example and specify the location of train.tfrecords with the full path.

Relevant information:

  • JOB_DIR points to the trainer directory
  • This image shows my directory structure
  • My setup.py file is below:

    from setuptools import find_packages
    from setuptools import setup
    
    REQUIRED_PACKAGES = ['tensorflow==1.3.0', 'opencv-python']
    
    setup(
        name='trainer',
        version='0.1',
        install_requires=REQUIRED_PACKAGES,
        packages=find_packages(),
        include_package_data=True,
        description='My trainer application package.'
    )
    
BrettJ
  • 6,801
  • 1
  • 23
  • 26
hannahrae
  • 61
  • 6

1 Answers1

0

When the job executes it will not be able to read data from your local machine. The easiest way to make TFRecord files available to your job is by copying them to GCS and then passing the location of the GCS files to your program as flags and using those flags to configure your readers and writers.

Jeremy Lewi
  • 6,386
  • 6
  • 22
  • 37
  • Thank you! I will try this (currently uploading the records to GCS) and let you know how it goes. Additionally, do you know where to find example task.py files that use flags? I have looked at this example but it uses argparse instead of tf.flags: https://github.com/GoogleCloudPlatform/cloudml-samples/blob/master/census/estimator/trainer/task.py – hannahrae Oct 05 '17 at 18:42
  • I think a lot of the TensorFlow examples use tf.flags but I'm not sure of any CMLE specific examples. – Jeremy Lewi Oct 06 '17 at 21:50