when enabled --l_emb , then testing the model it will raise an excption.
(py3) λ python test.py -fr ktf -d data\movielns10k\ -b 512 --max_length 30 --r_l 30 --r_emb 30 Using TensorFlow backend. 2019-04-09 22:31:54.683881: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 2019-04-09 22:31:54.924866: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1405] Found device 0 with properties: name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.6325 pciBusID: 0000:01:00.0 totalMemory: 11.00GiB freeMemory: 9.10GiB 2019-04-09 22:31:54.943914: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1484] Adding visible gpu devices: 0 2019-04-09 22:31:55.258021: I tensorflow/core/common_runtime/gpu/gpu_device.cc:965] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-04-09 22:31:55.271662: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0 2019-04-09 22:31:55.280244: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] 0: N 2019-04-09 22:31:55.287898: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1097] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3379 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
Layer (type) Output Shape Param #
embedding_1 (Embedding) (None, 30, 30) 89280
masking_1 (Masking) (None, 30, 30) 0
lstm_1 (LSTM) (None, 30) 7320
dense_1 (Dense) (None, 2976) 92256
activation_1 (Activation) (None, 2976) 0
Total params: 188,856 Trainable params: 188,856 Non-trainable params: 0
filename : data\movielns10k\models\ktf\rnn_cce_ml30_bs512_ne*_gc100_e30_h30_Ug_lr0.1_nt1.ktf ['data\movielns10k\models\ktf\rnn_cce_ml30_bs512_ne49.969_gc100_e30_h30_Ug_lr0.1_nt1.ktf' 'data\movielns10k\models\ktf\rnn_cce_ml30_bs512_ne149.969_gc100_e30_h30_Ug_lr0.1_nt1.ktf'] Opening file (1) Traceback (most recent call last): File "test.py", line 168, in
main() File "test.py", line 161, in main evaluator = run_tests(predictor, f, dataset, args, get_full_recommendation_list=args.save_rank, k=args.nb_of_predictions) File "test.py", line 55, in run_tests recommendations = predictor.top_k_recommendations(viewed, k=k) File "D:\Users\shwang\workspace\tests\LSTM-recommendation-model\neural_networks\rnn_base.py", line 105, in top_k_recommendations output = self.model.predict_on_batch(X) File "d:\Users\shwang\Anaconda3\envs\py3\lib\site-packages\keras\models.py", line 1041, in predict_on_batch return self.model.predict_on_batch(x) File "d:\Users\shwang\Anaconda3\envs\py3\lib\site-packages\keras\engine\training.py", line 1906, in predict_on_batch self._feed_input_shapes) File "d:\Users\shwang\Anaconda3\envs\py3\lib\site-packages\keras\engine\training.py", line 110, in _standardize_input_data 'with shape ' + str(data_shape)) ValueError: Error when checking : expected embedding_1_input to have 2 dimensions, but got array with shape (1, 30, 2976)