WeidiXie / VGG-Speaker-Recognition

Utterance-level Aggregation For Speaker Recognition In The Wild
363 stars 97 forks source link

TypeError: 'int' object is not callable #47

Closed IvanEvan closed 4 years ago

IvanEvan commented 4 years ago

Hi, Weidi . Thank you for your prompt reply !!! And sorry to interrupt again. As you said yesterday, I can successfully load the pre-training model. But I encountered a new mistake as the title shows. This time I used the following command line:

python main.py --net resnet34s --batch_size 3 --gpu 0 --lr 0.001 --ghost_cluster 2 --vlad_cluster 8 --warmup_ratio 0.1 --optimizer adam --epochs 20 --multiprocess 1 --loss softmax --data_path ''

I know that the model loaded successfully through the information displayed in the terminal. But after print Learning rate for epoch 1 is 0.0001., the new error occured.

*Exception in thread Thread-2: Traceback (most recent call last): File "/usr/local/anaconda3/envs/py3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/local/anaconda3/envs/py3.6/lib/python3.6/threading.py", line 864, in run self._target(self._args, self._kwargs) File "/usr/local/anaconda3/envs/py3.6/lib/python3.6/site-packages/keras/utils/data_utils.py", line 559, in _run sequence = list(range(len(self.sequence))) TypeError: 'int' object is not c

I think it's a multi-process or multi-threading problem. So I tried to set --multiprocess 0, or comment out areas of code that involve multiple processes. But nothing changed. I found one issues, he set --workers 0, so I changed fit_generator function's workers=0 in main.py. A "new" error occured:

*Traceback (most recent call last): File "main.py", line 223, in main() File "main.py", line 162, in main verbose=0) File "/usr/local/anaconda3/envs/py3.6/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(args, kwargs) File "/usr/local/anaconda3/envs/py3.6/lib/python3.6/site-packages/keras/engine/training.py", line 1418, in fit_generator initial_epoch=initial_epoch) File "/usr/local/anaconda3/envs/py3.6/lib/python3.6/site-packages/keras/engine/training_generator.py", line 181, in fit_generator generator_output = next(output_generator) File "/usr/local/anaconda3/envs/py3.6/lib/python3.6/site-packages/keras/engine/training_utils.py", line 590, in iter_sequence_infinite for item in seq: File "/usr/local/anaconda3/envs/py3.6/lib/python3.6/site-packages/keras/utils/data_utils.py", line 372, in iter for item in (self[i] for i in range(len(self))): TypeError: 'int' object is not callable

The same error TypeError: 'int' object is not callable occured, someone said that your custom variable name and the default function or class name duplicate will cause this problem. I can't solve the problem, So I would like to ask if you have come across this problem, or have any ideas to solve it.

Sorry again for the interruption, and thanks in advance !!!