Arturus / kaggle-web-traffic

1st place solution
MIT License
1.82k stars 667 forks source link

got an unexpected keyword argument 'input_size' #14

Closed Enjia closed 5 years ago

Enjia commented 6 years ago

When I run this command"python trainer.py --name s32 --hparam_set=s32 --n_models=3 --name s32 --no_eval --no_forward_split --asgd_decay=0.99 --max_steps=11500 --save_from_step=10500", an error occured: /usr/local/lib/python3.6/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Traceback (most recent call last): File "trainer.py", line 776, in train(**param_dict) File "trainer.py", line 514, in train all_models.append(create_model(scope, i, prefix=prefix, seed=seed + i)) File "trainer.py", line 471, in create_model train_model = Model(pipe, hparams, is_train=True, graph_prefix=prefix, asgd_decay=asgd_decay, seed=seed) File "/content/drive1/Codes/kaggle/Web_traffic_prediction/kaggle-web-traffic-master/model.py", line 371, in init transpose_output=False) File "/content/drive1/Codes/kaggle/Web_traffic_prediction/kaggle-web-traffic-master/model.py", line 72, in make_encoder static_p_size = cuda_params_size(build_rnn) File "/content/drive1/Codes/kaggle/Web_traffic_prediction/kaggle-web-traffic-master/model.py", line 46, in cuda_params_size cuda_model = cuda_model_builder() File "/content/drive1/Codes/kaggle/Web_traffic_prediction/kaggle-web-traffic-master/model.py", line 70, in build_rnn dropout=hparams.encoder_dropout if is_train else 0, seed=seed) TypeError: init() got an unexpected keyword argument 'input_size' After that I checked the document and source code of TensorFlow to find that the params "input_size" is actually exists in the definition of CudnnGRU.Can anybody tell me why this could happen? Thanks

Cibifang commented 6 years ago

Same problem.

I'm using Pthon3.6 and tensorflow1.5.0.

Cibifang commented 6 years ago

I checked the release and commit.

This code can't work for tensorflow 1.5.0 and after release. Because the CudnnGRU's defination is changed after it.

You can choose to use tensorflow 1.4.0 or change the CudnnGRU from tensorflow.contrib.cudnn_rnn.CudnnGRU to tensorflow.contrib.cudnn_rnn.python.ops.CudnnGRU

That's it.

waldstein1983 commented 6 years ago

Hello, I reinstall tensorflow 1.4 and change the import, but I get: ModuleNotFoundError: No module named 'tensorflow.contrib.cudnn_rnn.python.ops.CudnnGRU' Did you have the same issue?

nkonts commented 6 years ago

I had the same problem and tried Cibifangs approach. Installing tensorflow 1.4.0 resulted in the same error as: https://github.com/Arturus/kaggle-web-traffic/issues/13

It worked when I uninstalled tensorflow completely and installed tensorflow-gpu==1.4.0 instead.

Arturus commented 5 years ago

Fixed by last commit