Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

AttributeError: type object 'Callable' has no attribute '_abc_registry' in python 3.7 #16

Found a issue when using ludwig in py3.7 for integration with Neuropod.

LoadNeuropod modelPath = /mnt/mesos/sandbox/sandbox/tmp/DLInferenceTransformer_617b34558715_PID_dl_neuropod_integration_tests_ol_MID_tm20200609-061639-PQNLVETE-GQQUAF--1131379289 failed: AttributeError: type object 'Callable' has no attribute '_abc_registry'
At:
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/typing-3.7.4.1-py3.7.egg/typing.py(1005): __new__
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/typing-3.7.4.1-py3.7.egg/typing.py(1357): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/pandas/_config/config.py(54): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap>(1043): _handle_fromlist
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/pandas/_config/__init__.py(18): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap>(953): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(1050): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(1050): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(1050): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(1050): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(1050): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(1050): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/pandas/_libs/tslibs/__init__.py(3): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/pandas/_libs/__init__.py(3): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/pandas/__init__.py(38): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/ludwig/api.py(40): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  /tmp/tmp402pbr4s.neuropod_python_symlinks/650ddd3e_6a6c_49f3_9626_fc498297f596/ludwig/neuropod_export.py(10): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(967): _find_and_load_unlocked
  <frozen importlib._bootstrap>(983): _find_and_load
  <frozen importlib._bootstrap>(1006): _gcd_import
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/importlib/__init__.py(127): import_module
  /home/udocker/michelangelo-deeplearning-inference/env/lib/python3.7/site-packages/neuropod-0.2.0-py3.7-linux-x86_64.egg/neuropod/backends/python/executor.py(130): __init__

Dependency is

python_packages = ['pandas==0.25.3',
                   'numpy==1.16.6',
                   'scipy==1.4.1',
                   'scikit-learn==0.22.1',
                   'tensorflow==1.15.0',
                   'ludwig==0.2.2.4'],

Seems this issue is similar with https://github.com/alexa/alexa-skills-kit-sdk-for-python/issues/49
How to fix this issue in py3.7?

  • replies 6
  • views 2.6K
  • likes 0

Hi Peng, this looks like a problem with the typing package.
Check this out: https://github.com/ethereum/eth-abi/issues/131

After looking at the alexa repo you linked, in their case they were explicitly having typing as a dependency, which is not the case in Ludwig, so it it likelly being installed by other packages Ludwig depends on.
Not sure which library needs the typing dependency, but my best guess is that if it is present in the python environment when the neuropod is exported from the ludwig model, you should uninstall it before running python -m ludwig.utils.neuropod_utils ....

Let me know if this helps out.
Anyway, it is likely a dependency / interpreter / neuropod problem more than a Ludwig one.

#3

Yes, typing is a dependency of neuropod here
So I do not understand why it is not working with ludwig.
Is it because our ludwig model have a dependency on pandas==0.25.3, which is not compatible with typing-3.7.4.1?

#4

As you are using python 3.7, typing is not needed. You should be ok by just removing it from the virtualenv before creating the neuropod.

#5

Peng, did you try to remove "typing" from virtual env? If you share ludwig.zip, I can try to test it locally where I control virtualenv and can remove it manually before load.

#6

Confirmed it works in py37 by removing typing.

#7

That's great news :) Let me know if there are other problems.