Hi guys,
I really love fast.ai!! That’s why I chose it to work on my Master Thesis experiments
Unfortunately, I got stuck when following the Siamese network tutorial…
I want to build a similar architecture to the one shown in the Siamese tutorial.
Now the tutorial is structured as follows:
- First we see how it’s done with the Mid-level API.
- Then the Custom data block approach is introduced.
- But then for the training we revert back to the Mid-level API approach and grab the data like this.
However, I want to use the Custom data block (dataloader) from step 2 directly.
siamese = DataBlock(
blocks=(ImageTupleBlock, CategoryBlock),
get_items=get_tuples,
get_x=get_x, get_y=get_y,
splitter=splitter,
item_tfms=Resize(224),
batch_tfms=[Normalize.from_stats(*imagenet_stats)])
dls = siamese.dataloaders(files)
I tried:
learn = Learner(dls, model, loss_func=CrossEntropyLossFlat(), splitter=siamese_splitter, metrics=accuracy)
But I get the following error:
TypeError: forward() missing 1 required positional argument: ‘x2’
When I want to run
learn.lr_find()
Any idea why this might happen? What did I miss? Is there an intermediate step that is crucial that is not automatically applied by simply passing the dls object to the Learner?
I tried to find a similar topic in the forum, but couldn’t find someone who ran into the same kind of problem / error.