Dan*_*Dan 68 python tensorflow
我已经使用了tensorflow一天,但是有一些麻烦,当我导入tensorflow时,会出现AttributeError:'module'对象没有属性'XXXXXX'
我使用ubuntu14.04,python2.7,CUDA工具包8.0和CuDNN v5.我的六个和protobuf的版本是:名称:六个版本:1.10.0位置:/usr/local/lib/python2.7/dist-packages需要:名称:protobuf版本:3.2.0位置:/ usr/local/lib/python2.7/dist-packages需要:six,setuptools
这是我的测试代码:
import tensorflow as tf
a = tf.placeholder(tf.int16)
b = tf.placeholder(tf.int16)
add = tf.add(a, b)
mul = tf.mul(a, b)
with tf.Session() as sess:
# Run every operation with variable input
print "Addition with variables: %i" % sess.run(add, feed_dict={a: 2, b: 3})
print "Multiplication with variables: %i" % sess.run(mul, feed_dict={a: 2, b: 3})Run Code Online (Sandbox Code Playgroud)
我得到这个输出:
tensorflow安装有问题吗?还是其他任何问题?
小智 177
tf.mul,tf.sub并且tf.neg不赞成使用tf.multiply,tf.subtract和tf.negative.
你将需要更换tf.mul带tf.multiply.
| 归档时间: |
|
| 查看次数: |
58875 次 |
| 最近记录: |