Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible shapes #25

Open
dariusstephen opened this issue Jun 30, 2021 · 2 comments
Open

Incompatible shapes #25

dariusstephen opened this issue Jun 30, 2021 · 2 comments

Comments

@dariusstephen
Copy link

Hi,
Thank you for building and sharing this translation system.
I am trying out the eng_twi_transformer.ipynb using jupyter notebook with the provided data, jw300.en and jw300.tw.
Everything seems to work until I tried to execute the predict function (line 544).

Here are the results on the console:

Epoch 1 Batch 0 Loss 1.9547 Elapsed time 3.26s
Incompatible shapes: [1,74,128] vs. [73,128] [Op:AddV2]
Epoch 2 Batch 0 Loss 1.9929 Elapsed time 10.66s
Incompatible shapes: [1,74,128] vs. [73,128] [Op:AddV2]
...

I am not sure why this happens. Any help or advice is greatly appreciated.
Thank you.

@azunre
Copy link
Member

azunre commented Jun 30, 2021

Hello, thanks for your question. I would need more information and/or ability to replicate the error in order to help. It may simply be a versioning issue - perhaps the versions of libraries you have installed handle things differently and the code needs to be updated. Ideally, you can stand this up as either a Google Colab and/or a Kaggle kernel and share a link with us, so that we can replicate the error and take it from there.

Just glancing at your output, it seems the code is expecting the second shape to be [74,128] not [73,128]

@dariusstephen
Copy link
Author

dariusstephen commented Jul 1, 2021

Hi @azunre, thank you for the reply.
I do not change any code in the notebook and use the same dataset provided. I am actually not quite familiar with Google Colab or Kaggle however any advice is appreciated.

For my local spec, I am running the notebook using Jupyter notebook installed via Conda on Macbook M1.
Some of the relevant libraries I am using to test this notebook (conda list):

keras-nightly             2.5.0.dev2021032900          pypi_0    pypi
keras-preprocessing       1.1.2              pyhd8ed1ab_0    conda-forge
tensorboard               2.5.0                    pypi_0    pypi
tensorboard-data-server   0.6.1                    pypi_0    pypi
tensorboard-plugin-wit    1.8.0                    pypi_0    pypi
tensorflow-deps           2.5.0                         1    apple
tensorflow-estimator      2.5.0                    pypi_0    pypi
tensorflow-macos          2.5.0                    pypi_0    pypi

I also find this Kaggle link listed on the README, under Notebooks section for eng_twi_transformer.ipynb.
Looking at the notebook results, I can see the same error occurring on the In:[16] section.
Please find the attached screenshot for the errors highlight.

Screen Shot 2021-07-02 at 05 17 57

Any help or advice would be greatly appreciated.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants