ai-toolkit icon indicating copy to clipboard operation
ai-toolkit copied to clipboard

Slider text training error. AttributeError: 'int' object has no attribute 'int'

Open specblades opened this issue 2 years ago • 2 comments

I get this error using default yml config It happens after the Generating baseline samples.

Error running job: 'int' object has no attribute 'int'

========================================
Result:
 - 0 completed jobs
 - 1 failure
========================================
Traceback (most recent call last):
  File "S:\ai-toolkit\run.py", line 89, in <module>
    main()
  File "S:\ai-toolkit\run.py", line 85, in main
    raise e
  File "S:\ai-toolkit\run.py", line 77, in main
    job.run()
  File "S:\ai-toolkit\jobs\TrainJob.py", line 49, in run
    process.run()
  File "S:\ai-toolkit\jobs\process\BaseSDTrainProcess.py", line 1495, in run
    loss_dict = self.hook_train_loop(batch)
  File "S:\ai-toolkit\jobs\process\TrainSliderProcess.py", line 653, in hook_train_loop
    loss = apply_snr_weight(loss, timesteps_index_list, noise_scheduler,
  File "S:\ai-toolkit\toolkit\train_tools.py", line 791, in apply_snr_weight
    snr = torch.stack([all_snr[(t - offset).int()] for t in timesteps])
  File "S:\ai-toolkit\toolkit\train_tools.py", line 791, in <listcomp>
    snr = torch.stack([all_snr[(t - offset).int()] for t in timesteps])
AttributeError: 'int' object has no attribute 'int'

specblades avatar Jan 22 '24 22:01 specblades

@specblades I had the same error. I solved it by removing .int() from line 791 of train_tools.py, which was giving the error. I don't know if it has any other implications though, but it worked for now.

iamrohitanshu avatar Jan 28 '24 12:01 iamrohitanshu

Did this dev die or just give a you know what? I just ran into this error and this is July 20 and your comment is from Jan 28. WTH?

DarkAlchy avatar Jul 20 '24 19:07 DarkAlchy