title: Why the tensorflow script doesn't work?
body: <p>I'm learning tensorflow and got a strange error. When I type the code in a text editor and run it as a .py file, it doesn't work, but if I type it line by line in python interactive command line, it works well and gives expected result. This code is from official tutorial:</p>
  
  <pre><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)
  </code></pre>
  
  <p>using <code>python tf_contrib_learn_basic_usage.py</code>, it results:</p>
  
  <pre><code>I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfu
  lly opened CUDA library cublas64_80.dll locally
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfu
  lly opened CUDA library cudnn64_5.dll locally
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfu
  lly opened CUDA library cufft64_80.dll locally
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfu
  lly opened CUDA library nvcuda.dll locally
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfu
  lly opened CUDA library curand64_80.dll locally
  WARNING:tensorflow:Using temporary folder as model directory: C:\Users\ljxfo\AppData\Local\Temp\tmpvx8ucski
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions
  E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('
  op: "UpdateFertileSlots" device_type: "CPU"') for unknown op: UpdateFertileSlots
  WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dim
  s. It is highly recommended that you resize your input, as this behavior may change.
  WARNING:tensorflow:From C:\Users\ljxfo\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\tensorflow\contrib\le
  arn\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 T
  ensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor o
  r list of tags to a scalar summary op is no longer supported.
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:885] F
  ound device 0 with properties:
  name: GeForce GT 635M
  major: 2 minor: 1 memoryClockRate (GHz) 0.95
  pciBusID 0000:01:00.0
  Total memory: 2.00GiB
  Free memory: 1.65GiB
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:906] D
  MA: 0
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:916] 0
  :   Y
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:948] I
  gnoring visible gpu device (device: 0, name: GeForce GT 635M, pci bus id: 0000:01:00.0) with Cuda compute capability 2.1
  . The minimum required Cuda capability is 3.0.
  WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dim
  s. It is highly recommended that you resize your input, as this behavior may change.
  WARNING:tensorflow:From C:\Users\ljxfo\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\tensorflow\contrib\le
  arn\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 T
  ensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor o
  r list of tags to a scalar summary op is no longer supported.
  I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:948] I
  gnoring visible gpu device (device: 0, name: GeForce GT 635M, pci bus id: 0000:01:00.0) with Cuda compute capability 2.1
  . The minimum required Cuda capability is 3.0.
  WARNING:tensorflow:Skipping summary for global_step, must be a float or np.float32.
  </code></pre>
  
  <p>I understand that my laptop with gtx635m is not perfectly supported with cuda, but the code works well when typed line by line. So what's wrong with this?</p>