AttributeError: module 'tensorflow._api.v1.compat.v2' has no attribute '__internal__'
r-a-17 opened this issue · 2 comments
Hello Suyash,
I am trying to run your project on Colab as I am new to this but I am facing some issues.
1) When running: !chmod +x setup.sh !./setup.sh I am receiving following errors :- ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow-probability 0.12.1 requires gast>=0.3.2, but you have gast 0.2.2 which is incompatible.
kapre 0.3.5 requires tensorflow>=2.0.0, but you have tensorflow 1.15.0 which is incompatible.
2) After this when I run !python3 speechEmotionRecognition.py receiving this error:- Using TensorFlow backend.
Traceback (most recent call last):
File "speechEmotionRecognition.py", line 2, in
import keras
File "/usr/local/lib/python3.7/dist-packages/keras/init.py", line 3, in
from . import utils
File "/usr/local/lib/python3.7/dist-packages/keras/utils/init.py", line 26, in
from .vis_utils import model_to_dot
File "/usr/local/lib/python3.7/dist-packages/keras/utils/vis_utils.py", line 7, in
from ..models import Model
File "/usr/local/lib/python3.7/dist-packages/keras/models.py", line 10, in
from .engine.input_layer import Input
File "/usr/local/lib/python3.7/dist-packages/keras/engine/init.py", line 3, in
from .input_layer import Input
File "/usr/local/lib/python3.7/dist-packages/keras/engine/input_layer.py", line 7, in
from .base_layer import Layer
File "/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py", line 12, in
from .. import initializers
File "/usr/local/lib/python3.7/dist-packages/keras/initializers/init.py", line 124, in
populate_deserializable_objects()
File "/usr/local/lib/python3.7/dist-packages/keras/initializers/init.py", line 49, in populate_deserializable_objects
LOCAL.GENERATED_WITH_V2 = tf.internal.tf2.enabled()
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/util/module_wrapper.py", line 193, in getattr
attr = getattr(self._tfmw_wrapped_module, name)
AttributeError: module 'tensorflow._api.v1.compat.v2' has no attribute 'internal'
Hey @r-a-17,
- For setup.sh:
When running: !chmod +x setup.sh !./setup.sh I am receiving following errors
This is absolutely okay. The incompatibility errors have no effect on the libraries we are using in the code. So you can safely ignore this for now.
- For speechEmotionRecognition.py:
After this when I run !python3 speechEmotionRecognition.py receiving this error
AttributeError: module 'tensorflow._api.v1.compat.v2' has no attribute 'internal'
Recently, colab upgraded the tensorflow version to 2.5.0, due to which keras-nightly package was also upgraded. Taking this into account, I have updated the setup.sh file in a210643
Try running the demo on colab (here) now that the issue is solved! Let us know if you face any other problems.
Best,
Chinmay
Hi @chinmaynehate , Its works fine now. Thanks for help!