google-deepmind / learning-to-learn

Learning to Learn in TensorFlow
https://arxiv.org/abs/1606.04474
Apache License 2.0
4.06k stars 601 forks source link

Learning-to-learn code doesn't run after dependencies met AFAIK with an error message. #6

Closed shyamalschandra closed 7 years ago

shyamalschandra commented 7 years ago

I tried the following command as instructed by the directions in the README.md:

python train.py --problem=mnist --save_path=./mnist

The output from the run:

iMac:learning-to-learn shyamalsuhanachandra$ python train.py --problem=mnist --save_path=./mnist
Extracting MNIST-data/train-images-idx3-ubyte.gz
Extracting MNIST-data/train-labels-idx1-ubyte.gz
Extracting MNIST-data/t10k-images-idx3-ubyte.gz
Extracting MNIST-data/t10k-labels-idx1-ubyte.gz
Optimizee variables
[u'mlp/linear_0/w:0', u'mlp/linear_0/b:0', u'mlp/linear_1/w:0', u'mlp/linear_1/b:0']
Problem variables
[]
Traceback (most recent call last):
  File "train.py", line 115, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
    sys.exit(main(sys.argv))
  File "train.py", line 68, in main
    second_derivatives=FLAGS.second_derivatives)
  File "/Users/shyamalsuhanachandra/learning-to-learn/meta.py", line 398, in meta_minimize
    info = self.meta_loss(make_loss, len_unroll, **kwargs)
  File "/Users/shyamalsuhanachandra/learning-to-learn/meta.py", line 370, in meta_loss
    reset = [tf.variables_initializer(variables), fx_array.close()]
AttributeError: 'module' object has no attribute 'variables_initializer'

What should I do to solve this problem as I am running the code for the first time?

sergomezcol commented 7 years ago

tf.variables_initializer replaced tf.initialize_all_variables in TensorFlow 0.12 (https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md#breaking-changes-to-the-api-1). It sounds like you're using an older version.

Any chance you can upgrade to the latest version of TensorFlow and try to rerun the script?

shyamalschandra commented 7 years ago

Thanks! It works now!