papagina / Auto_Conditioned_RNN_motion

Implementation of Auto-Conditioned Recurrent Networks for Extended Complex Human Motion Synthesis
MIT License
67 stars 26 forks source link

Error 'float' object is not subscriptable #10

Open Ammola opened 5 years ago

Ammola commented 5 years ago

Hi I got an error when I run the file pytorch_train_aclstm.py

<ipython-input-13-4f37744e12e2> in train_one_iteraton(real_seq_np, model, optimizer, iteration, save_dance_folder, print_loss, save_bvh_motion)
    140     if(print_loss==True):
    141         print ("###########"+"iter %07d"%iteration +"######################")
--> 142         print ("loss: "+str(loss.data.tolist()[0]))
    143 
    144 

TypeError: 'float' object is not subscriptable
papagina commented 5 years ago

I guess you are using a newer pytorch. In that case, you can change loss.data.tolist()[0] to loss.item()