Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 5 code errors in cnn sample #19

Open
JohnFarl opened this issue Jan 9, 2017 · 1 comment
Open

Chapter 5 code errors in cnn sample #19

JohnFarl opened this issue Jan 9, 2017 · 1 comment

Comments

@JohnFarl
Copy link

JohnFarl commented Jan 9, 2017

I have already fixed some errors by myself however the way how parameters are passed in this method seems wrong and I get the error got an unexpected keyword argument

layer_one = tf.contrib.layers.convolution2d(
float_image_batch,
num_output_channels=32,
kernel_size=(5,5),
activation_fn=tf.nn.relu,
weight_init=tf.random_normal,
stride=(2, 2),
trainable=True)

More details on my Stackoverflow question
http://stackoverflow.com/questions/41539658/tensorflow-error-when-i-try-to-use-tf-contrib-layers-convolution2d/41540092#41540092

@JohnFarl JohnFarl changed the title Chapter 5 code error in cnn sample Chapter 5 code errors in cnn sample Jan 9, 2017
@irwenqiang
Copy link

irwenqiang commented Feb 2, 2017

      conv2d_layer_one = tf.contrib.layers.convolution2d(                
      float_image_batch,                  
      #num_output_channels=32,     # The number of filters to generate               
      num_outputs=32,           
      kernel_size=(5,5),                     # It's only the filter height and width.          
      activation_fn=tf.nn.relu,        
      #weight_init=tf.random_normal,         
      weights_initializer=tf.random_normal_initializer(),        
      stride=(2, 2),        
      trainable=True)       

my updated code seems OK.
The version of tf used in book is 0.8.0 as mentioned in requirements, my version is latest 0.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants