kedartatwawadi / NN_compression

MIT License
212 stars 42 forks source link

There is a bug in code #2

Open viviancui59 opened 6 years ago

viviancui59 commented 6 years ago

Dear sir, hello,I try to run your code in Linux server, but there is a bug : ValueError: Dimensions must be equal, but are 256 and 130 for 'rnn/while/rnn/multi_rnn_cell/cell_0/cell_0/basic_rnn_cell/MatMul_1' (op: 'MatMul') with input shapes: [?,256], [130,128].
Is it my problem? Can you answer my problem? thank you

hhliao commented 6 years ago

I got the same Error. it seems that somewhere the 2*hidden_size have been changed to 2+hidden_size.

viviancui59 commented 6 years ago

thank you! Do u solve this problem?I try to change some parameters like but this problem still exist. If you successfully debug, could u tell me ? Thank you!

hhliao commented 6 years ago

I also struggled with this problem. OK, I will give a message here, if I solved.

ZhouYC627 commented 6 years ago

I have the same problem. Since the paper was published recently, this code might not be up-to-date.

kedartatwawadi commented 6 years ago

Hi all! Thanks for reporting the bug. I am currently on vacation until Thursday, Jan 18th. I will take a look at the bug after the same.

kedartatwawadi commented 6 years ago

The code was developed on Tensorflow 0.12.1 and is working fine on this version. The bug seems to be coming in the latest stable version TF1.4

I am working on getting the code working on newer version, but until then you may run on the older version (0.12.1)

suikammd commented 6 years ago

@viviancui59 hi, do you get the expected results as the author provided? Thanks for replying.

fwip commented 6 years ago

Please consider documenting such version requirements, in a requirements.txt if nothing else.

kedartatwawadi commented 6 years ago

apologies. created a requirements.txt.

fwip commented 6 years ago

Thanks!

sonack commented 6 years ago

I found the fix solution!

Change the Line 61 of src/models/sequence_predictor_model.py cell = tf.nn.rnn_cell.MultiRNNCell([cell] * self.config.num_layers, state_is_tuple=False) to

def new_cell():
            if self.config.model_type == "gru":
                cell = tf.nn.rnn_cell.GRUCell(self.config.hidden_size)
            elif self.config.model_type == "rnn":
                cell = tf.nn.rnn_cell.BasicRNNCell(self.config.hidden_size)
            return cell
cell = tf.nn.rnn_cell.MultiRNNCell([new_cell() for _ in range(self.config.num_layers)], state_is_tuple = False)