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: 'int' object has no attribute 'strip' (error when trying to train on custom data in Google Colab) #133

Closed
mwzhu opened this issue Jan 5, 2022 · 2 comments

Comments

@mwzhu
Copy link

mwzhu commented Jan 5, 2022

I am trying to train on custom data but when I use the command python main.py --base configs/custom_vqgan.yaml -t True --gpus 0, in Google Colab it gives me this error:

Global seed set to 23
Running on GPUs 0
Working with z of shape (1, 256, 16, 16) = 65536 dimensions.
loaded pretrained LPIPS loss from taming/modules/autoencoder/lpips/vgg.pth
VQLPIPSWithDiscriminator running with hinge loss.
/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loggers/test_tube.py:105: LightningDeprecationWarning: The TestTubeLogger is deprecated since v1.5 and will be removed in v1.7. We recommend switching to the pytorch_lightning.loggers.TensorBoardLogger as an alternative.
"The TestTubeLogger is deprecated since v1.5 and will be removed in v1.7. We recommend switching to the"
/usr/local/lib/python3.7/dist-packages/pytorch_lightning/loops/utilities.py:94: PossibleUserWarning: max_epochs was not set. Setting it to 1000 epochs. To train without an epoch limit, set max_epochs=-1.
category=PossibleUserWarning,
/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/connectors/callback_connector.py:143: LightningDeprecationWarning: Setting Trainer(checkpoint_callback=<pytorch_lightning.callbacks.model_checkpoint.ModelCheckpoint object at 0x7f54a9d41910>) is deprecated in v1.5 and will be removed in v1.7. Please consider using Trainer(enable_checkpointing=<pytorch_lightning.callbacks.model_checkpoint.ModelCheckpoint object at 0x7f54a9d41910>).
f"Setting Trainer(checkpoint_callback={checkpoint_callback}) is deprecated in v1.5 and will "
GPU available: True, used: False
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py:1720: PossibleUserWarning: GPU available but not used. Set the gpus flag in your trainer Trainer(gpus=1) or script --gpus=1.
category=PossibleUserWarning,
Traceback (most recent call last):
File "/content/taming-transformers/main.py", line 536, in
ngpu = len(lightning_config.trainer.gpus.strip(",").split(','))
AttributeError: 'int' object has no attribute 'strip'

@mwzhu mwzhu closed this as completed Jan 8, 2022
@christegho
Copy link

How did you resolve this issue?

@christegho
Copy link

Figured it out:
python3 main.py --base configs/custom_vqgan.yaml -t True --gpus 0,

I was missing the comma at the end.

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