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

Error when importing elmofromanylans in my code #100

Open
francoislievens opened this issue Oct 24, 2021 · 1 comment
Open

Error when importing elmofromanylans in my code #100

francoislievens opened this issue Oct 24, 2021 · 1 comment

Comments

@francoislievens
Copy link

I have install the package in my anaconda env without problems.

When i use it in my python 3.8 code,
at the line "from elmofromanylangs import Embedder"

i have the following error:

File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\elmoformanylangs-0.0.4.post2-py3.8.egg\elmoformanylangs\__init__.py", line 2, in <module> from .elmo import Embedder File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\elmoformanylangs-0.0.4.post2-py3.8.egg\elmoformanylangs\elmo.py", line 12, in <module> from .frontend import create_one_batch File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\elmoformanylangs-0.0.4.post2-py3.8.egg\elmoformanylangs\frontend.py", line 10, in <module> from .modules.token_embedder import ConvTokenEmbedder, LstmTokenEmbedder File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\elmoformanylangs-0.0.4.post2-py3.8.egg\elmoformanylangs\modules\token_embedder.py", line 8, in <module> from .highway import Highway File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\elmoformanylangs-0.0.4.post2-py3.8.egg\elmoformanylangs\modules\highway.py", line 12, in <module> class Highway(torch.nn.Module): File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\elmoformanylangs-0.0.4.post2-py3.8.egg\elmoformanylangs\modules\highway.py", line 47, in Highway def forward(self, inputs: torch.Tensor) -> torch.Tensor: # pylint: disable=arguments-differ File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\overrides-6.1.0-py3.8.egg\overrides\overrides.py", line 88, in overrides return _overrides(method, check_signature, check_at_runtime) File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\overrides-6.1.0-py3.8.egg\overrides\overrides.py", line 114, in _overrides _validate_method(method, super_class, check_signature) File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\overrides-6.1.0-py3.8.egg\overrides\overrides.py", line 135, in _validate_method ensure_signature_is_compatible(super_method, method, is_static) File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\overrides-6.1.0-py3.8.egg\overrides\signature.py", line 93, in ensure_signature_is_compatible ensure_return_type_compatibility(super_type_hints, sub_type_hints, method_name) File "C:\Users\franc\.conda\envs\torch3\lib\site-packages\overrides-6.1.0-py3.8.egg\overrides\signature.py", line 287, in ensure_return_type_compatibility raise TypeError( TypeError: Highway.forward: return type <class 'torch.Tensor'> is not a <class 'NoneType'>.

What can i do?
Thanks a lot

@rochanaph
Copy link

Try this:
pip uninstall overrides
pip install overrides==3.1.0
I found it in stackoverflow and it worked for me.
https://stackoverflow.com/a/67438055/4832492

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