I’ve seen this error on a few other posts but haven’t found a solution that works after the past few hours. I’m trying to make a cycleGAN instance that makes pictures of dogs cubic (like the art form), similar to the forests -> abstract art medium project. I used the download technique from dl1 lesson 2 to pull 300 pics of dogs/cubic art and stored them in folders called cubed/dogs and cubed/cubes, respectively. Since I’m using a cycleGAN project, however, I needed to create a custom ImageTupleList (which I directly copy/pasted from the dl2 tutorial). However, the following line of code (specifically the .databunch() part) throws the aforementioned error:
data = (ImageTupleList.from_folders(path, 'cubes', 'dogs') .split_none() .label_empty() .transform(get_transforms(), size=128) .databunch(bs=4))
I’m guessing this is because the image size pulled from google isn’t standardized but I’d think the size part of the transforms function would fix that? Would really appreciate any advice. Also, is there a better reference for implementing cycleGANS / modern GANs through the fastai library? Thanks in advance.
I needed to add the following line to the apply_tfms method in the ImageTuple class
self.data = [-1+2self.img1.data,-1+2self.img2.data]
My transformations were being applied to to the images but not to the underlying tensors. This transformation/normalization fixed the problem.