You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this code is using an older version of tensorflow, here are some edits i made to spec_augment_tensorflow.py to make it compatible with tensorflow 2.9.1:
change line 40 import statement "import tensorflow as tf" to "import tensorflow.compat.v1 as tf"
change line 41 import statement "from tensorflow.contrib.image import sparse_image_warp" to "from tensorflow_addons.image import sparse_image_warp"
This still threw an error about "eager execution" wrt the "placeholder" function when trying to run the "spec_augment" function. I fixed it by inserting the command "tf.disable_eager_execution" on line 75 before the call of the placeholder function.
ModuleNotFoundError Traceback (most recent call last)
in ()
32 import librosa, librosa.display
33 from audiomentations import Compose, AddGaussianNoise, FrequencyMask, TimeStretch, PitchShift, Shift
---> 34 from specAugment import spec_augment_tensorflow
35 import IPython
36 import soundfile as sf
/usr/local/lib/python3.7/dist-packages/specAugment/spec_augment_tensorflow.py in ()
39 import librosa.display
40 import tensorflow as tf
---> 41 from tensorflow.contrib.image import sparse_image_warp
42 import numpy as np
43 import random
ModuleNotFoundError: No module named 'tensorflow.contrib'
The text was updated successfully, but these errors were encountered: