Forums

tensorflow

Hi, I am trying/learning tensorflow on pythonanywhere. I have isntalled it on python2.7. While running the examples I get lots of warnings. Is my installation wrong or do I need to change any config? "

<code>

import tensorflow as tf

import numpy as np

features = [tf.contrib.layers.real_valued_column("x",dimension=1)]

estimator = tf.contrib.learn.LinearRegressor(feature_columns=features)

x = np.array([1., 2., 3., 4.])

y = np.array([0., -1., -2., -3.])

input_fn = tf.contrib.learn.io.numpy_input_fn({"x":x}, y, batch_size=4, num_epochs=1000)

estimator.fit(input_fn=input_fn, steps=1000)

estimator.evaluate(input_fn=input_fn)

print " done" </code>

<blockquote>

WARNING:tensorflow:Using temporary folder as model directory: /tmp/tmpzjcYdb INFO:tensorflow:Using default config. INFO:tensorflow:Using config: {'_save_checkpoints_secs': 600, '_num_ps_replicas': 0, '_keep_checkpoint_max': 5, '_tf_random_seed': None, '_task_type': None, '_environment': 'local', '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f907ec2ee90>, '_tf_config': gpu_options { per_process_gpu_memory_fraction: 1.0 } , '_task_id': 0, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_evaluation_master': '', '_keep_checkpoint_every_n_hours': 10000, '_master': ''} WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change. WARNING:tensorflow:From /home/guruprasanna/tf/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/head.py:1362: scalar_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30. Instructions for updating: Please switch to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor or list of tags to a scalar summary op is no longer supported. INFO:tensorflow:Create CheckpointSaverHook. INFO:tensorflow:Saving checkpoints for 1 into /tmp/tmpzjcYdb/model.ckpt. INFO:tensorflow:loss = 2.5, step = 1 INFO:tensorflow:global_step/sec: 1004.25 INFO:tensorflow:loss = 0.0509978, step = 101 INFO:tensorflow:global_step/sec: 817.241 INFO:tensorflow:loss = 0.00587901, step = 201 INFO:tensorflow:global_step/sec: 760.739 INFO:tensorflow:loss = 2.51489e-06, step = 301 INFO:tensorflow:global_step/sec: 848.515 INFO:tensorflow:loss = 0.000245041, step = 401 INFO:tensorflow:global_step/sec: 889.015 INFO:tensorflow:loss = 2.83987e-05, step = 501 INFO:tensorflow:global_step/sec: 1037.6 INFO:tensorflow:loss = 2.51842e-06, step = 601 INFO:tensorflow:global_step/sec: 1011.46 INFO:tensorflow:loss = 6.77449e-07, step = 701 INFO:tensorflow:global_step/sec: 1277.63 INFO:tensorflow:loss = 1.09545e-07, step = 801 INFO:tensorflow:global_step/sec: 1710.81 INFO:tensorflow:loss = 1.94771e-08, step = 901 INFO:tensorflow:Saving checkpoints for 1000 into /tmp/tmpzjcYdb/model.ckpt. INFO:tensorflow:Loss for final step: 5.99356e-09. WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change. WARNING:tensorflow:From /home/guruprasanna/tf/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/head.py:1362: scalar_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30. Instructions for updating: Please switch to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor or list of tags to a scalar summary op is no longer supported. INFO:tensorflow:Starting evaluation at 2017-04-03-13:07:08 INFO:tensorflow:Finished evaluation at 2017-04-03-13:07:09 INFO:tensorflow:Saving dict for global step 1000: global_step = 1000, loss = 4.20225e-09 WARNING:tensorflow:Skipping summary for global_step, must be a float or np.float32.

</blockquote>

Possibly a version mismatch? Check that the example is for the version of tensorflow that you're using.