Open Philmod opened 4 months ago
In the meantime, I use:
class CustomDataset(Dataset):
def __init__(self, dataframe):
self.dataframe = dataframe
def __getitem__(self, index):
row = self.dataframe.iloc[index].to_numpy()
features = row[1:]
label = row[0]
return features, label
def __len__(self):
return len(self.dataframe)
train_df = pd.read_csv('https://raw.githubusercontent.com/osipov/smlbook/master/train.csv')
train_ds = CustomDataset(dataframe=train_df)
train_dl = DataLoader(train_ds, pin_memory=True)
Also, in the same chapter 10, I'm getting another error: 'list' object has no attribute 'squeeze_'
, unclear if it's linked to the previous issue.
Hi,
I tried to use
osds
with the examples from your book, but each time it returns this type of error (same in the previous chapter when using files from s3).