CodeTalker icon indicating copy to clipboard operation
CodeTalker copied to clipboard

Question about training error in stage 1

Open GIT-LZL629 opened this issue 3 years ago • 6 comments

Traceback (most recent call last): File "/media/E/3DTalk/CodeTalker-main/main/train_pred.py", line 242, in main() File "/media/E/3DTalk/CodeTalker-main/main/train_pred.py", line 48, in main main_worker(args.train_gpu, args.ngpus_per_node, args) File "/media/E/3DTalk/CodeTalker-main/main/train_pred.py", line 109, in main_worker loss_train, motion_loss_train, reg_loss_train = train(train_loader, model, loss_fn, optimizer, epoch, cfg) File "/media/E/3DTalk/CodeTalker-main/main/train_pred.py", line 148, in train model.autoencoder.eval() File "/home/anaconda3/envs/3d/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'VQAutoEncoder' object has no attribute 'autoencoder'

Could you tell me where is the "autoencoder"?

GIT-LZL629 avatar Apr 06 '23 00:04 GIT-LZL629

Hi. What is your training command and actual training code (.py)? It seems that you are training discrete motion prior (stage1) using the stage2 training script?

Doubiiu avatar Apr 06 '23 02:04 Doubiiu

Thanks for replying to me.

sh scripts/train.sh CodeTalker_s1 config/vocaset/stage1.yaml vocaset s1

GIT-LZL629 avatar Apr 06 '23 02:04 GIT-LZL629

Hi. It seems that the script "train.sh" cannot correctly work for the stage1/stage2 if condition in your bash shell. I think a simple way is just to replace the training code in train.sh for different stages, for example, just comment out L14-22 in train.sh, and When you are training stage 1, add the following code below L22: TRAIN_CODE=train_vq.py TEST_CODE=test_vq.py When you are training stage 2, add the following code below L22: TRAIN_CODE=train_pred.py TEST_CODE=test_pred.py Anyway, you need to make sure that you are using train_vq.py/test_vq.py for stage 1, train_pred.py/test_pred.py for stage 2.

Doubiiu avatar Apr 06 '23 05:04 Doubiiu

It is a pretrained moel weights of wav2vec2 released by facebook. If it cannot be automatically downloaded, you can download these files manually and change the path to your local wav2vec2-base-960h folder.

Doubiiu avatar Apr 06 '23 08:04 Doubiiu

if [ "${stage}" = "s1" ]; then

MagicRedZero avatar May 09 '23 07:05 MagicRedZero

Yes! I encountered the same error and solved it with this method

sxyddo35831 avatar Jul 31 '23 01:07 sxyddo35831