Comments (20)
Thank you for your concern
"""
print("==> Start training ...")
net.train()
for epoch in range(start_epoch, epochs + start_epoch):
running_loss = 0.0
for batch_idx, (data1, data2, data3) in enumerate(trainloader):
if is_gpu:
device = torch.device("cuda" if torch.cuda.is_avaliable() else "cpu")
data1, data2, data3 = data1.to(device), data2.to(device), data3.to(device)
# wrap in torch.autograd.Variable
data1, data2, data3 = Variable(
data1), Variable(data2), Variable(data3)
# compute output and loss
embedded_a, embedded_p, embedded_n = net(data1, data2, data3)
loss = criterion(embedded_a, embedded_p, embedded_n)
this is my code after update
is it true ?
from image-similarity-using-deep-ranking.
It looks good. Could you give a try?
Please feel free to reach out if you still have that error message. ^_^
from image-similarity-using-deep-ranking.
Python 3.6.8 |Anaconda, Inc.| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
>>>
from image-similarity-using-deep-ranking.
^_^
i have another message error :(
==> Initialize CUDA support for TripletNet model ...
==> Building new TripletNet model ...
==> Preparing Tiny ImageNet dataset ...
==> Start training ...
Traceback (most recent call last):
File "main.py", line 111, in <module>
main()
File "main.py", line 107, in main
testloader, args.start_epoch, args.epochs, args.is_gpu)
File "D:\deep-ranking\model7\utils.py", line 99, in train
device = torch.device('cuda:0' if torch.cuda.is_avaliable() else 'cpu')
AttributeError: module 'torch.cuda' has no attribute 'is_avaliable'
from image-similarity-using-deep-ranking.
Did you
import torch.cuda
from image-similarity-using-deep-ranking.
yes ,
i searched on Same page and other pages but i still have the same problem
from image-similarity-using-deep-ranking.
(deep-ranking) D:\deep-ranking\model7>python
Python 3.6.8 |Anaconda, Inc.| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch.nn as nn
>>> torch.cuda.is_available()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'torch' is not defined
>>> import torch.cuda
>>> torch.cuda.is_available()
True
>>>
from image-similarity-using-deep-ranking.
the problem solved
but training loss 0.0
(deep-ranking) D:\deep-ranking\model7>python main.py
==> Initialize CUDA support for TripletNet model ...
==> Building new TripletNet model ...
==> Preparing Tiny ImageNet dataset ...
==> Start training ...
Training Epoch: 1 | Loss: 0.0
Training Epoch: 2 | Loss: 0.0
Training Epoch: 3 | Loss: 0.0
why loss 0.0 ?? what is the problem
from image-similarity-using-deep-ranking.
Did you re-generate triplets of pics or use the .txt
file in this repo? In my own experiment, the log.txt
file contains all the training process output. Did you change any parameters? Have you met this issue all the time? 🤔
from image-similarity-using-deep-ranking.
yes , i generate new triplets of pics,
i dont made any change of parameters :(
from image-similarity-using-deep-ranking.
Have you already solved this problem? I cannot help you tuning parameters for the loss currently since I do not have a GPU to run on my laptop. 🤔
from image-similarity-using-deep-ranking.
A problem still exists :(
I am working on solving it
from image-similarity-using-deep-ranking.
So the training loss is still 0
? Did you double check the triplets of image (the generated txt
file)? Is it reasonable?
from image-similarity-using-deep-ranking.
yes still 0...
i checked it , the same with your triplets.txt
from image-similarity-using-deep-ranking.
i think the problem is overfitting
weights overfit with datasets
but how i solve this problems
from image-similarity-using-deep-ranking.
i solved the problem
thanks for your concern
from image-similarity-using-deep-ranking.
Glad to hear this. ~
from image-similarity-using-deep-ranking.
Hey I have the same problem but this code is not working for me.
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
data1, data2, data3 = data1.to(device), data2.to(device), data3.to(device)
Have you any idea what the problem is?
from image-similarity-using-deep-ranking.
So now I fixed the problem. The right code is this(utils.py(91)):
print("==> Start training ...")
net.train()
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
net.to(device)
from image-similarity-using-deep-ranking.
unfinished
from image-similarity-using-deep-ranking.
Related Issues (12)
- Inference HOT 3
- how to test with one query image and other images ?
- Missing txt files HOT 3
- License
- MemoryError HOT 1
- How to test just two images in testing stage? HOT 2
- How to choose the best model to save?
- Is the loss ok or not?
- ValueError: operands could not be broadcast together with shapes (100000,128) (200000,128) HOT 2
- About the accuracy(when I run the accuracy.py)~~~Many thanks~~~ HOT 2
- Generating triplets HOT 2
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-using-deep-ranking.