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

Importing Nengo_DL in Google Colab #235

Open
SerhiiBahdas opened this issue Oct 21, 2023 · 1 comment
Open

Importing Nengo_DL in Google Colab #235

SerhiiBahdas opened this issue Oct 21, 2023 · 1 comment

Comments

@SerhiiBahdas
Copy link

SerhiiBahdas commented Oct 21, 2023

Hello there!

I'm encountering an issue with importing nengo_dl in Google Colab. The error states that 'keras.engine' is not available. Here's what I've tried:

  1. Attempted to resolve it by downgrading keras to version 2.2.1 using 'pip install keras==2.2.1,' but a new error occurred.
  2. The new error suggests that Colab cannot import 'Iterable' from 'collections,' possibly a Python compatibility issue.

Could you please help me resolve this? Thank you in advance, you guys are awesome!

ISSUE # 1

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-700eed500250> in <cell line: 1>()
----> 1 import nengo_dl

2 frames
/usr/local/lib/python3.10/dist-packages/nengo_dl/compat.py in <module>
     79     )
     80 else:
---> 81     from keras.engine.functional import Functional, _build_map
     82     from keras.layers import BatchNormalizationV1, BatchNormalizationV2
     83 

ModuleNotFoundError: No module named 'keras.engine'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

ISSUE # 2

Using TensorFlow backend.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-700eed500250> in <cell line: 1>()
----> 1 import nengo_dl

10 frames
/usr/local/lib/python3.10/dist-packages/keras/callbacks.py in <module>
     16 from collections import deque
     17 from collections import OrderedDict
---> 18 from collections import Iterable
     19 from .utils.generic_utils import Progbar
     20 from . import backend as K

ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
 
@sleepingcat4
Copy link

@SerhiiBahdas please use my forked version where I have fixed the issue of keras.engine

pip install git+https://github.com/sleepingcat4/nengo-dl.git

I've opened a pull request to this library and hopefully the maintainers will merge it pretty quick

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

No branches or pull requests

2 participants