TensorLayer icon indicating copy to clipboard operation
TensorLayer copied to clipboard

module 'tensorflow' has no attribute 'placeholder'

Open gtm2122 opened this issue 2 years ago • 1 comments

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

  • Which OS are you using ? Linux x86_64
  • Please provide a reproducible code of your issue. Without any reproducible code, you will probably not receive any help.

[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')


gtm2122 avatar Oct 10 '22 23:10 gtm2122

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

zsdonghao avatar Oct 11 '22 02:10 zsdonghao