I'm using this code in colab. the function below gives me an error when intanciar.
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.utils.data as data
import torchvision
from torchvision import transforms
def load_images(image_size=32, batch_size=64, root=""):
transform = transforms.Compose([
transforms.Resize(32),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
train_set = torchvision.datasets.ImageFolder(root=root, train=True,transform=transform)
train_loader = torch.utils.data.DataLoader(train_set, batch_size=batch_size, shuffle=True, num_workers=2)
return train_loader
data = load_images (28.64, "/ content / data /")
error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-85-a809f71788e0> in <module>()
----> 1 datotes=load_images(28,64,"/content/datitos/")
<ipython-input-84-0b4989f589a9> in load_images(image_size, batch_size, root)
15 transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
16
---> 17 train_set = torchvision.datasets.ImageFolder(root=root, train=True,transform=transform)
18 train_loader = torch.utils.data.DataLoader(train_set, batch_size=batch_size, shuffle=True, num_workers=2)
19
TypeError: __init__() got an unexpected keyword argument 'train'