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: 'numpy.ndarray' object has no attribute 'decode' #18

Open
ritvd opened this issue Jun 30, 2022 · 1 comment
Open

AttributeError: 'numpy.ndarray' object has no attribute 'decode' #18

ritvd opened this issue Jun 30, 2022 · 1 comment

Comments

@ritvd
Copy link

ritvd commented Jun 30, 2022

This happens here:

import torchvision.transforms as T

device = torch.device("cuda")
transform = T.Compose([
T.ToTensor()])
tokenizer = Tokenizer(charset_base)

train_loader = torch.utils.data.DataLoader(DataGenerator(source_path,charset_base,max_text_length,'train',transform), batch_size=batch_size, shuffle=False, num_workers=2)
val_loader = torch.utils.data.DataLoader(DataGenerator(source_path,charset_base,max_text_length,'valid',transform), batch_size=batch_size, shuffle=False, num_workers=2)

The error I get is:
self.dataset[self.split]['gt'] = [x.decode() for x in self.dataset[self.split]['gt']]

AttributeError: 'numpy.ndarray' object has no attribute 'decode' #18

@ritvd ritvd closed this as completed Jun 30, 2022
@ritvd ritvd changed the title where did you upload the hdf5 files in your drive? AttributeError: 'numpy.ndarray' object has no attribute 'decode' Jun 30, 2022
@ritvd ritvd reopened this Jun 30, 2022
@him4318
Copy link
Owner

him4318 commented Jul 1, 2022

Hi,
Can you check your data loader, this is with it only instead of text it is getting arrays.

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