attention-translation-keras icon indicating copy to clipboard operation
attention-translation-keras copied to clipboard

Getting incorrect dimensions

Open ghost opened this issue 7 years ago • 10 comments

I followed the exact commands mentioned in your readme and before training i am getting the following errors

ValueError: Error when checking target: expected time_distributed_1 to have 3 dimensions, but got array with shape (1120, 40005)

ghost avatar Jun 13 '18 14:06 ghost

What version of tf and keras are you using?

divamgupta avatar Jun 13 '18 19:06 divamgupta

tensorflow:-1.4.0 keras:-2.0.9

ghost avatar Jun 14 '18 03:06 ghost

Could you try the latest verision keras and let me know.

divamgupta avatar Jun 14 '18 06:06 divamgupta

Can you mention the version that you are using.It's too ambiguos to know what's the latest version means to be

ghost avatar Jun 15 '18 05:06 ghost

I am getting the following errors after installing the following versions keras: 2.2.0 tensorflow: 1.8.0

Epoch 0

Epoch 1/1 2018-06-15 13:30:40.705992: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-06-15 13:30:41.124806: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.133977: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.146665: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory. 2018-06-15 13:30:41.166433: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.174544: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.187663: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory. 2018-06-15 13:30:41.283361: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory. 2018-06-15 13:30:41.299205: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.315461: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.328358: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory. 2018-06-15 13:30:41.390824: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.406671: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory. 2018-06-15 13:30:41.427286: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory. 2018-06-15 13:30:41.442281: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory. 2018-06-15 13:30:41.467440: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.467780: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.469035: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory. 2018-06-15 13:30:41.502380: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.514799: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.537815: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.549917: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.589259: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.602441: W tensorflow/core/framework/allocator.cc:101] Allocation of 18003000 exceeds 10% of system memory. 2018-06-15 13:30:41.602441: W tensorflow/core/framework/allocator.cc:101] Allocation of 30725120 exceeds 10% of system memory.

I eventually had to kill the process

ghost avatar Jun 15 '18 08:06 ghost

Looks like it is a warning thrown by tensorflow because of less memory https://github.com/tensorflow/tensorflow/issues/18736 . Are you traininig your model using a GPU?. Training might be extremely slow without a GPU.

divamgupta avatar Jun 15 '18 09:06 divamgupta

I am using the CPU @divamgupta could you say the keras and tensorflow version you are using ?

ghost avatar Jun 15 '18 09:06 ghost

keras 2.1.4 and tensorflow 1.4.0 .

divamgupta avatar Jun 15 '18 10:06 divamgupta

@divamgupta ,yeah gpu is solving the issue and I am training my model.

Can you specify a bit more on the type of attention you are using ?

ghost avatar Jun 19 '18 07:06 ghost

Also how are you predicting the outputs ? It will be great if you are using beam search thing

ghost avatar Jun 19 '18 07:06 ghost