philipperemy / deep-speaker

Deep Speaker: an End-to-End Neural Speaker Embedding System.
MIT License
897 stars 239 forks source link

Model Testing Issue #95

Closed WisamAbbasi closed 1 year ago

WisamAbbasi commented 1 year ago

Hello,

Thanks for this great project, but testing the code using the line wrote in the description produces below error:

File "cli.py", line 99, in cli() File "/home/wisam/.local/lib/python3.8/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/home/wisam/.local/lib/python3.8/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/home/wisam/.local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/wisam/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/wisam/.local/lib/python3.8/site-packages/click/core.py", line 760, in invoke return __callback(args, **kwargs) File "cli.py", line 70, in test_model test(working_dir, checkpoint_file) File "/mnt/c/Users/wisam/Desktop/deep-speaker-master/testing.py", line 78, in test fm, tpr, acc, eer = eval_model(working_dir, model=dsm) File "/mnt/c/Users/wisam/Desktop/deep-speaker-master/testing.py", line 37, in eval_model batcher = LazyTripletBatcher(working_dir, NUM_FRAMES, model) File "/mnt/c/Users/wisam/Desktop/deep-speaker-master/batcher.py", line 151, in init self.update_triplets_history() File "/mnt/c/Users/wisam/Desktop/deep-speaker-master/batcher.py", line 165, in update_triplets_history embeddings = self.model.m.predict(np.array(model_inputs)) File "/home/wisam/.local/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered_tb) from None File "/home/wisam/.local/lib/python3.8/site-packages/keras/engine/training.py", line 2048, in predict raise ValueError('Unexpected result of predict_function ' ValueError: Unexpected result of predict_function (Empty batch_outputs). Please use Model.compile(..., run_eagerly=True), or tf.config.run_functions_eagerly(True) for more information of where went wrong, or file a issue/bug to tf.keras.

philipperemy commented 1 year ago

Look like the new version of Tensorflow/Keras is no longer supported. Can you try with keras== 2.3.1 and tensorflow== 2.3? Or older versions of Keras/TF? Just to see if you still have the issue.

WisamAbbasi commented 1 year ago

I have updated the versions of the libraries, but I still get the below error, I think it is related to the data:

2022-08-12 12:52:17,046 - INFO - Picking audio from C:\Users\wisam\Desktop\deep-speaker-master.deep-speaker-wd\triplet-training. Initializing the batcher: 0%| | 0/4 [00:00<?, ?it/s] Traceback (most recent call last): File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1156, in _truncate_execution_to_epoch self._steps_per_execution.assign(self._inferred_steps) AttributeError: 'int' object has no attribute 'assign'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "cli.py", line 99, in cli() File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\click\core.py", line 1128, in call return self.main(args, kwargs) File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\click\core.py", line 1053, in main rv = self.invoke(ctx) File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\click\core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\click\core.py", line 1395, in invoke return ctx.invoke(self.callback, ctx.params) File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\click\core.py", line 754, in invoke return __callback(args, *kwargs) File "cli.py", line 70, in test_model test(working_dir, checkpoint_file) File "C:\Users\wisam\Desktop\deep-speaker-master\testing.py", line 78, in test fm, tpr, acc, eer = eval_model(working_dir, model=dsm) File "C:\Users\wisam\Desktop\deep-speaker-master\testing.py", line 37, in eval_model batcher = LazyTripletBatcher(working_dir, NUM_FRAMES, model) File "C:\Users\wisam\Desktop\deep-speaker-master\batcher.py", line 151, in init self.update_triplets_history() File "C:\Users\wisam\Desktop\deep-speaker-master\batcher.py", line 165, in update_triplets_history embeddings = self.model.m.predict(np.array(model_inputs)) File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\tensorflow\python\keras\engine\training.py", line 130, in _method_wrapper return method(self, args, **kwargs) File "C:\Users\wisam\anaconda3\envs\Speech_RecognitionVerification\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1595, in predict for , iterator in data_handler.enumerate_epochs(): # Single epoch. File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1137, in enumerate_epochs with self._truncate_execution_to_epoch(): File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\contextlib.py", line 112, in enter return next(self.gen) File "C:\Users\wisam\anaconda3\envs\Speech_Recognition_Verification\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1161, in _truncate_execution_to_epoch self._steps_per_execution.assign(original_value) AttributeError: 'int' object has no attribute 'assign'

philipperemy commented 1 year ago

@WisamAbbasi try to run the examples in the README. Does it work? Let's start with that first.

philipperemy commented 1 year ago

Likely to be a dataset issue. You have to scrupulously follow the same dataset structure as the one described in the README. Later, we should probably make it more user friendly.