Closed thomastiotto closed 4 years ago
TF 2.3.0 compatibility was just recently added to NengoDL, so it isn't in the latest release (3.2.0). If you do a developer installation then everything should work. The NengoDL 3.3.0 release should be out within a week or two (there's just a couple other changes we want to get in first).
NengoDL 3.3.0 has now been released, so this should be resolved!
Great, but the breaking changes introduced to the build process could have been documented and pointed out :)
There is this section in the release notes:
Internal NengoDL OpBuilder classes now separate the "pre build" stage from
OpBuilder.__init__
(so that the same OpBuilder class can be re-used across multiple calls, rather than instantiating a new OpBuilder each time). Note that this has no impact on front-end users, this is only relevant to anyone that has implemented a custom build class. The logic that would previously have gone inOpBuilder.__init__
should now go inOpBuilder.build_pre
. In addition, the ops argument has been removed fromOpBuilder.build_pre
; that will be passed toOpBuilder.__init__
( and will be available inbuild_pre
asself.ops
). Similarly, the ops and config argument have been removed frombuild_post
, and can instead be accessed throughself.ops/config
.
Or is it a different change you are referring to?
Yes, that exactly. I read through the notes but missed that one, sorry!
I just compiled TensorFlow 2.3.0 from source but I'm getting the following error when trying to run my code:
Traceback (most recent call last): File "/Users/thomastiotto/opt/anaconda3/envs/nengodl_opt/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3343, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-8961a12e9037>", line 1, in <module> runfile('/Users/thomastiotto/PycharmProjects/Memristor_Learning/experiments/test_builder_mPES.py', wdir='/Users/thomastiotto/PycharmProjects/Memristor_Learning/tests') File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/Users/thomastiotto/PycharmProjects/Memristor_Learning/experiments/test_builder_mPES.py", line 2, in <module> import nengo_dl File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "/Users/thomastiotto/opt/anaconda3/envs/nengodl_opt/lib/python3.7/site-packages/nengo_dl/__init__.py", line 58, in <module> from nengo_dl import callbacks, compat, converter, dists, losses File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "/Users/thomastiotto/opt/anaconda3/envs/nengodl_opt/lib/python3.7/site-packages/nengo_dl/callbacks.py", line 20, in <module> from nengo_dl import compat, utils File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "/Users/thomastiotto/opt/anaconda3/envs/nengodl_opt/lib/python3.7/site-packages/nengo_dl/compat.py", line 14, in <module> from tensorflow.python.keras.engine import network ImportError: cannot import name 'network' from 'tensorflow.python.keras.engine' (/Users/thomastiotto/opt/anaconda3/envs/nengodl_opt/lib/python3.7/site-packages/tensorflow/python/keras/engine/__init__.py)
Everything was fine in TensorFlow 2.1.0 so it seems as if something changed internally in either v2.2.0 or 2.3.0 .