magenta / ddsp

DDSP: Differentiable Digital Signal Processing
https://magenta.tensorflow.org/ddsp
Apache License 2.0
2.86k stars 331 forks source link

ImportError: cannot import name 'dtensor_api' from 'keras.dtensor' #507

Open ultranoise opened 10 months ago

ultranoise commented 10 months ago

Hi, I am training a new model at the Colab linked from the VST (https://colab.research.google.com/github/magenta/ddsp/blob/main/ddsp/colab/demos/Train_VST.ipynb). I am running it connected with a T4.

During DDSP installation I get the error below. Is there any incompatibility between the version of tensorflow and keras? how can I solve it?


Installing DDSP... This should take about 2 minutes...


ImportError Traceback (most recent call last)

/usr/local/lib/python3.10/dist-packages/ipyfilechooser/filechooser.py in _on_select_click(self, _b) 315 if self._callback is not None: 316 try: --> 317 self._callback(self) 318 except TypeError: 319 # Support previous behaviour of not passing self

12 frames

/usr/local/lib/python3.10/dist-packages/keras/engine/base_layer_utils.py in 22 23 from keras import backend ---> 24 from keras.dtensor import dtensor_api as dtensor 25 from keras.utils import control_flow_util 26 from keras.utils import tf_inspect

ImportError: cannot import name 'dtensor_api' from 'keras.dtensor' (/usr/local/lib/python3.10/dist-packages/keras/dtensor/init.py)

robinmeier commented 10 months ago

I have the same problem.. here's the output i get:

Installing DDSP... This should take about 2 minutes...

ImportError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/ipyfilechooser/filechooser.py in _on_select_click(self, _b) 315 if self._callback is not None: 316 try: --> 317 self._callback(self) 318 except TypeError: 319 # Support previous behaviour of not passing self

12 frames /usr/local/lib/python3.10/dist-packages/keras/engine/base_layer_utils.py in 22 23 from keras import backend ---> 24 from keras.dtensor import dtensor_api as dtensor 25 from keras.utils import control_flow_util 26 from keras.utils import tf_inspect

ImportError: cannot import name 'dtensor_api' from 'keras.dtensor' (/usr/local/lib/python3.10/dist-packages/keras/dtensor/init.py)

caiotikaraishi commented 9 months ago

Me too. I have the same problem. I tested it on both Windows and iOS, but the problem remains the same.

Installing DDSP... This should take about 2 minutes...

ImportError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/ipyfilechooser/filechooser.py in _on_select_click(self, _b) 315 if self._callback is not None: 316 try: --> 317 self._callback(self) 318 except TypeError: 319 # Support previous behaviour of not passing self

12 frames /usr/local/lib/python3.10/dist-packages/keras/engine/base_layer_utils.py in 22 23 from keras import backend ---> 24 from keras.dtensor import dtensor_api as dtensor 25 from keras.utils import control_flow_util 26 from keras.utils import tf_inspect

ImportError: cannot import name 'dtensor_api' from 'keras.dtensor' (/usr/local/lib/python3.10/dist-packages/keras/dtensor/init.py)

fhog commented 9 months ago

Hi, it seems that we are more and more having the same issue 👍 If someone get infos about that...

Installing DDSP... This should take about 2 minutes...

ImportError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/ipyfilechooser/filechooser.py in _on_select_click(self, _b) 315 if self._callback is not None: 316 try: --> 317 self._callback(self) 318 except TypeError: 319 # Support previous behaviour of not passing self

12 frames /usr/local/lib/python3.10/dist-packages/keras/engine/base_layer_utils.py in 22 23 from keras import backend ---> 24 from keras.dtensor import dtensor_api as dtensor 25 from keras.utils import control_flow_util 26 from keras.utils import tf_inspect

ImportError: cannot import name 'dtensor_api' from 'keras.dtensor' (/usr/local/lib/python3.10/dist-packages/keras/dtensor/init.py)

AJourdan commented 8 months ago

Also getting the same error - Anyone figure it out?

yk7244 commented 8 months ago

Before running the training code, try this

!pip uninstall -y keras tensorflow tensorflow-probability absl-py astunparse flatbuffers gast google-pasta grpcio h5py keras keras-preprocessing libclang numpy opt-einsum protobuf setuptools six tensorboard tensorflow-io-gcs-filesystem termcolor tf-estimator-nightly typing-extensions wrapt !pip install --disable-pip-version-check --no-cache-dir tensorflow==2.11.0 !pip install tensorflow-probability==0.15.0 !pip install keras==2.11.0