Closed FTKyaoyuan closed 2 years ago
The above is my training code, but there is an error So I can change the existing code change to
But other errors occurred
These seem to be related to the version of pytorch
You can tell me dalle2_ pytorch Do you want to use the version of python and the version of python
@FTKyaoyuan ohh oops, thanks for reporting the first error! https://github.com/lucidrains/DALLE2-pytorch/commit/d0c11b30b081a26dc22fb7cdcb2c6750316acc27
the second error, i believe you are passing in text as floats instead of indices (text token ids)
Thanks I understand but first error , I change my clip
from dalle2_pytorch.dalle2_pytorch import OpenClipAdapter
clip = OpenAIClipAdapter("ViT-L/14")
change to
from dalle2_pytorch.dalle2_pytorch import OpenAIClipAdapter
clip = OpenAIClipAdapter("ViT-L/14")
there would be no first mistake Maybe their imange_size return types are different
I have solved the second problem
By the way, what is the minimum GPU required for training using the config file and how much GPU memory
and another The code in the example using Dataloaders is
dataloader = create_image_embedding_dataloader(
tar_url="/path/or/url/to/webdataset/{0000..9999}.tar", # Uses bracket expanding notation. This specifies to read all tars from 0000.tar to 9999.tar
embeddings_url="path/or/url/to/embeddings/folder", # Included if .npy files are not in webdataset. Left out or set to None otherwise
num_workers=4,
batch_size=32,
shard_width=4, # If a file in the webdataset shard 3 is named 0003039.jpg, we know the shard width is 4 and the last three digits are the index
shuffle_num=200, # Does a shuffle of the data with a buffer size of 200
shuffle_shards=True, # Shuffle the order the shards are read in
resample_shards=False, # Sample shards with replacement. If true, an epoch will be infinite unless stopped manually
)
for img, emb in dataloader:
print(img.shape) # torch.Size([32, 3, 256, 256])
print(emb.shape) # torch.Size([32, 512])
but in my code meb.type() is dict
so maybe right coda is
print(img.shape) # torch.Size([32, 3, 256, 256])
print(emb["img"].shape) # torch.Size([32, 512])
``