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

Input shape incompatibility #28

Open
Jacopown opened this issue Aug 14, 2022 · 2 comments
Open

Input shape incompatibility #28

Jacopown opened this issue Aug 14, 2022 · 2 comments

Comments

@Jacopown
Copy link

I'm running the script on a perfectly functioning conda env. I'm on a macbook pro M1.
This winter i've used this tool frequently and never had any problem, after a full reset of my laptop the tool si giving me this error:

Traceback (most recent call last):
  File "/Users/jacopown/Applications/simple-ehm/simple_ehm-runnable.py", line 455, in <module>
    analyze_track(model, waveform, sample_rate)
  File "/Users/jacopown/Applications/simple-ehm/simple_ehm-runnable.py", line 136, in timed
    output = f(*args, **kw)
  File "/Users/jacopown/Applications/simple-ehm/simple_ehm-runnable.py", line 296, in analyze_track
    prediction = model(spectrogram)
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tf/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tf/lib/python3.9/site-packages/keras/engine/input_spec.py", line 264, in assert_input_compatibility
    raise ValueError(f'Input {input_index} of layer "{layer_name}" is '
ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 124, 129, 1), found shape=(1, 125, 129)
Exception ignored in: <function tqdm.__del__ at 0x150ac0a60>
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tf/lib/python3.9/site-packages/tqdm/std.py", line 1162, in __del__
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tf/lib/python3.9/site-packages/tqdm/std.py", line 1304, in close
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tf/lib/python3.9/site-packages/tqdm/std.py", line 1301, in fp_write
TypeError: 'NoneType' object is not callable

Simply running the command as:

python3 simple_ehm-runnable.py <filename.mp4>

I don't know if it's useful:
python = 3.9.13
conda = 4.13.0
tensorflow-macos = 2.9.2
tensorflow-metal = 0.5.0

@gcarlino97
Copy link

gcarlino97 commented Apr 22, 2023

hello, i have a similar problem, macbook air m1.
has anyone been able to solve it?

/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.2
  warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
WARNING:tensorflow:SavedModel saved prior to TF 2.5 detected when loading Keras model. Please ensure that you are saving the model with model.save() or tf.keras.models.save_model(), *NOT* tf.saved_model.save(). To confirm, there should be a file named "keras_metadata.pb" in the SavedModel directory.
Metal device set to: Apple M1

systemMemory: 8.00 GB
maxCacheSize: 2.67 GB

extracting audio track...
analyzing track...
  0%|                                                                                                                                                                         | 0/2320000 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/Users/gc/Documents/gitApp/simple-ehm/simple_ehm-runnable.py", line 314, in <module>
    analyze_track(model, waveform, sample_rate)
  File "/Users/gc/Documents/gitApp/simple-ehm/simple_ehm-runnable.py", line 92, in timed
    output = f(*args, **kw)
  File "/Users/gc/Documents/gitApp/simple-ehm/simple_ehm-runnable.py", line 189, in analyze_track
    prediction = model(spectrogram)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/keras/engine/input_spec.py", line 298, in assert_input_compatibility
    raise ValueError(
ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 124, 129, 1), found shape=(1, 125, 129)
  0%|

@XSparter
Copy link
Contributor

XSparter commented Sep 2, 2023

Hi, try now.
I think we have fixed the issues with tensor flow.

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

No branches or pull requests

3 participants