Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: can't set attribute #204

Open
jatinarora96 opened this issue Jan 12, 2023 · 1 comment
Open

AttributeError: can't set attribute #204

jatinarora96 opened this issue Jan 12, 2023 · 1 comment

Comments

@jatinarora96
Copy link

Hi, I'm getting this error at the start of training for all the models. Below is the exact error:
`---> 28 ai.train(data, batch_size=32, num_steps=50000, generate_every=5000, save_every=5000)

/miniconda3/envs/test_env/lib/python3.8/site-packages/aitextgen/aitextgen.py in train(self, train_data, output_dir, fp16, fp16_opt_level, n_gpu, tpu_cores, max_grad_norm, gradient_accumulation_steps, seed, learning_rate, weight_decay, adam_epsilon, warmup_steps, num_steps, save_every, generate_every, n_generate, loggers, batch_size, num_workers, benchmark, avg_loss_smoothing, save_gdrive, run_id, progress_bar_refresh_rate, freeze_layers, num_layers_freeze, use_deepspeed, **kwargs)
673 # force single-GPU on Windows
674 if platform.system() == "Windows" and is_gpu_used and n_gpu != 1:
--> 675 logger.warning(
676 "Windows does not support multi-GPU training. Setting to 1 GPU."
677 )

/miniconda3/envs/test_env/lib/python3.8/site-packages/aitextgen/train.py in init(self, model, dataset, hparams, tokenizer)
19 def init(self, model, dataset, hparams, tokenizer):
20 super(ATGTransformer, self).init()
---> 21 self.model, self.dataset, self.hparams, self.tokenizer = (
22 model,
23 dataset,

/miniconda3/envs/test_env/lib/python3.8/site-packages/torch/nn/modules/module.py in setattr(self, name, value)
1311 buffers[name] = value
1312 else:
-> 1313 super().setattr(name, value)
1314
1315 def delattr(self, name):

AttributeError: can't set attribute`
Can someone help in resolving this issue, Thanks in advance

@calumrodger
Copy link

calumrodger commented Jan 21, 2023

I was hitting the same error, having reverted to version 0.5.1 following a previous error which affected generation too, after reading the comments of @mirrorsonthewall and @rmc135 on the discussion thread for the initial issue here: #200

Happily I was able to resolve both issues by applying the fix by @llimllib on PR #202 - as highlighted by @carmocca on the same issue thread mentioned above

to reiterate @carmocca's recommendation: if you're using the colab notebook provided, change the first line !pip install aitextgen to !pip install git+https://github.com/llimllib/aitextgen@fix_tpu_available to install from @llimllib's branch

hopefully that will resolve the problem for you too, and I expect will resolve the issue for good once the PR is merged with the main branch (or until the next dependency update anyway!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants