tensorlayer / TensorLayer

Deep Learning and Reinforcement Learning Library for Scientists and Engineers
http://tensorlayerx.com
Other
7.34k stars 1.61k forks source link

module 'tensorflow' has no attribute 'placeholder' #1160

Open gtm2122 opened 2 years ago

gtm2122 commented 2 years ago

New Issue Checklist

Issue Description

[INSERT DESCRIPTION OF THE PROBLEM]

When I do pip install tensorflow-gpu==2.0.0-rc1 I get an error ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==2.0.0-rc1 (from versi ons: 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0) ERROR: No matching distribution found for tensorflow-gpu==2.0.0-rc1

Upon looking at the versions I See that there is no 2.0.0 but there is a 2.10.0rc1, I install this version. When I install this version I get the error module 'tensorflow' has no attribute 'placeholder' when trying to run the sample code below

Reproducible Code

[INSERT CODE HERE]

import tensorflow as tf
batch_size = 1
nw = 1
nh = 1
nz = 1
t_image_good = tf.placeholder('float32', [batch_size, nw, nh, nz], name='good_image')
zsdonghao commented 2 years ago

The placeholder is for TensorFlow 1.0, we use TensorFlow 2.0 in the latest TensorLayer