是这样的,因为一直用R进行数据分析,比较习惯了,不想用python,最近学了:“R语言中使用TensorFlow构建一个用于图像分类的卷积神经网络”的文章,但是当我运行到:创建一个占位符号的时候发生了问题,困扰我一个月而不能往下走了:
创建一个输入占位符变量:
x = tf$raw_ops$Placeholder(tf$float32, shape=shape(NULL, img_size_flat), name='x')
Error in py_get_attr_impl(x, name, silent) :
AttributeError: module 'tensorflow' has no attribute 'placeholder'
x = tf$raw_ops$Placeholder(tf$float32, shape=shape(NULL, img_size_flat), name='x')
Error in py_call_impl(callable, dots$args, dots$keywords) :
TypeError: placeholder only takes keyword args (possible keys: ['dtype', 'shape', 'name']). Please pass these args as kwargs instead.
tf_version()
[1] ‘2.6’
因为我的TF版本是2.6的,所以估计这个代码肯定不行,我想请教各位,有没有办法解决: