shensq04 / EKLAVYA

56 stars 16 forks source link

train.py ValueError #1

Closed enjhnsn2 closed 4 years ago

enjhnsn2 commented 6 years ago

Hello, I have been able to compute the embeddings fine, however when I run train.py, I get Traceback (most recent call last): File "train.py", line 298, in <module> main() File "train.py", line 294, in main training(config_info) File "train.py", line 232, in training model.train() File "train.py", line 170, in train feed_dict = feed_dict File "PATH/tensorflow/python/client/session.py", line 895, in run run_metadata_ptr) File "PATH/tensorflow/python/client/session.py", line 1100, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (0,) for Tensor u'Placeholder:0', which has shape '(?, 500, 256)'

Earlier in the program I get UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. "

This warning happens on the line train_op = tf.train.AdamOptimizer().minimize(self.cost, global_step) in Model.optimize in train.py.

This creation of a tensor instead of an IndexedSlice is likely issue since it is a Tensor size mismatch that causes an issue. Any ideas?

Note: It is possible it has something to do with how I am formulating the split_func_path file. I use the example from the README and then manually pickle it and give the pickled splitFuncDict to train.py, is that correct?

curtisghc commented 6 years ago

Maybe I'm 7 months late, but the reason for that error is an empty batch of training data. I believe you're specifying "clean_pickles" as you -d data file, but you must actually specify "clean_pickles/x86" or "clean_pickles/x64" and train different RNNs for both 32 and 64 bit binaries.

enjhnsn2 commented 6 years ago

@curtisghc lol, ya I eventually figured that out