Comments (7)
Hi! most probably the dimensions of your image are not same. You would need to resize them.
This is due to assumption int the tutorial that all the images have shape of (512, 512). For images of different size, you would need different embeddings dimensions.
from image_similarity.
Hi! I have the same problem, however changing the dimensions of the image doesn't fix the problem.
`Setting Seed for the run, seed = 42
------------ Creating Dataset ------------
------------ Dataset Created ------------
------------ Creating DataLoader ------------
------------ Dataloader Cretead ------------
MSELoss()
GPU Availaible moving models to GPU
------------ Training started ------------
0%| | 0/30 [00:00<?, ?it/s]
Traceback (most recent call last):
File "E:/Work/UNI/Third_year_first_semester/Szoftver tervezes/Projekt/Image recognition repos/image_similarity/image_similarity-master/image_similarity/torch_train.py", line 79, in
train_loss = torch_engine.train_step(
File "E:\Work\UNI\Third_year_first_semester\Szoftver tervezes\Projekt\Image recognition repos\image_similarity\image_similarity-master\image_similarity\torch_engine.py", line 47, in train_step
return loss.item()
UnboundLocalError: local variable 'loss' referenced before assignment
Process finished with exit code 1`
from image_similarity.
Have you written in the torch_train.py
code. If yes then it should work fine.
loss_fn = nn.MSELoss()
from image_similarity.
Unfortunately it does not. The train-image-similarity.ipynb also has this problem.
from image_similarity.
I'm still perplexed. It should run as I had tested this code (long time ago) and it ran fine.
Even the ipynb has the output.
from image_similarity.
Can you share a reproducible script over colab so that I can debug?
from image_similarity.
I think you just use a small size images for test. So you can modify drop_last from True to False in torch_train.py.
train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=config.TRAIN_BATCH_SIZE, shuffle=True, drop_last=False)
from image_similarity.
Related Issues (7)
- problem in train code ,embedding = torch.cat((embedding, enc_output), 0)
- Fine-tuning HOT 2
- Where can I get the animals dataset for the training script ? HOT 3
- Where can we get the sample dataset you use? Or could you share about the conditions the dataset should satisfy? HOT 2
- Animals dataset HOT 3
- Miss encoder checkpoint HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image_similarity.