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 6? #5

Open
camrongodbout opened this issue Aug 1, 2016 · 9 comments
Open

Chapter 6? #5

camrongodbout opened this issue Aug 1, 2016 · 9 comments

Comments

@camrongodbout
Copy link

Is any code available from chapter 6 particularly the Char RNN?

@vgoklani
Copy link

vgoklani commented Aug 1, 2016

I'm looking for the chapter code 6 code too. Thanks!

@samjabrahams
Copy link
Collaborator

Hey guys! I'll do what I can to get it up in the next day or two!

@vgoklani
Copy link

vgoklani commented Aug 2, 2016

Thanks! and thanks for writing the book!!! If you're even in NYC one day, let's grab coffee.

@wfs
Copy link

wfs commented Aug 7, 2016

Really enjoying the book. Thank you! Looking forward to the Chapter 6 code.

@samjabrahams
Copy link
Collaborator

Just wanted to provide an update: this has not been forgotten! I'm just over halfway cleaning up the code and setting up to be run "out-of-the-box" from the repo. The past week has been nuts with travel.

SOON™

@samjabrahams
Copy link
Collaborator

I've gone through and added full, functioning-out-of-the-box code for chapter 6. I still want to clean up a few things as well as add Python 2 versions of everything (a few libraries shifted between 2.7 and 3+), but you can start toying around with the examples! Here's a generated arXiv abstract on a hastily trained network from the final example in the chapter:

Win on a Tesla K40c GPU benefiting deep learning framework for human posers for ternail arn performance representation performed sortimate visual smy practic of different types of recurrent also describes the distingy by trained Deep Neural Networks are describes the difter op ining state-yperformentank Neural Network (CNN) on 4 data sets, space. The provided as the state of the art method ob structures deep neural networks can be trained from ImageNet, and extract, search datasets than a conventio

@cgmircea
Copy link

cgmircea commented Aug 21, 2017

Hi,

I tried to use the code from chapter 6 in an interactive python session, but I get the following error:

ValueError: Variable rnn/gru_cell/gates/kernel already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

File "", line 83, in prediction
sequence_length=self.length,
File "", line 65, in init
self.prediction
File "", line 173, in
model = SequenceLabellingModel(data, target, params)

Any ideas?
Thanks!

I have found a fix, by adding a reuse member and setting it in prediction like this:
@Property
def prediction(self):
output, _ = tf.nn.dynamic_rnn(
tf.contrib.rnn.GRUCell(self.params.rnn_hidden, reuse=self.reuse),
self.data,
dtype=tf.float32,
sequence_length=self.length,
)
if not self.reuse:
self.reuse = True

@danijar
Copy link
Collaborator

danijar commented Sep 26, 2017

I also have a gist for a char-rnn in TensorFlow that works very similar to the one described in the book: https://gist.github.com/danijar/c70e7f7811231ce0cecceea76d07ffed

@mupengX
Copy link

mupengX commented Dec 24, 2017

i run the char-rnn code and got this
ValueError: Dimensions must be equal, but are 400 and 283 for 'rnn/while/rnn/multi_rnn_cell/cell_0/cell _0/gru_cell/MatMul_2' (op: 'MatMul') with input shapes: [?,400], [283,400].
with tf version 1.4.1

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

7 participants