Training model in Keras(TF backend) with GPU Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsSwitching Keras backend Tensorflow to GPUMaking Keras + Tensorflow code execution deterministic on a GPUUsing TensorFlow with Intel GPUHow to transition between offline and online learning?Multi GPU in kerasLoss plateaus off in neural style transferIssue with Custom object detection using tensorflow when Training on a single type of objectTraining Inception V3 based model using Keras with Tensorflow Backendcan't install tensorflow with gpuUsing CPU after training in GPU
Significance of Cersei's obsession with elephants?
Does the Weapon Master feat grant you a fighting style?
Chinese Seal on silk painting - what does it mean?
What font is "z" in "z-score"?
Why aren't air breathing engines used as small first stages?
When a candle burns, why does the top of wick glow if bottom of flame is hottest?
Dating a Former Employee
Is it a good idea to use CNN to classify 1D signal?
Sum letters are not two different
Do wooden building fires get hotter than 600°C?
SF book about people trapped in a series of worlds they imagine
If my PI received research grants from a company to be able to pay my postdoc salary, did I have a potential conflict interest too?
How do living politicians protect their readily obtainable signatures from misuse?
Is this homebrew Lady of Pain warlock patron balanced?
What does the "x" in "x86" represent?
Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?
Can anything be seen from the center of the Boötes void? How dark would it be?
How would a mousetrap for use in space work?
Did MS DOS itself ever use blinking text?
How does the math work when buying airline miles?
How do I use the new nonlinear finite element in Mathematica 12 for this equation?
How to tell that you are a giant?
What is the effect of altitude on true airspeed?
What is the meaning of the simile “quick as silk”?
Training model in Keras(TF backend) with GPU
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsSwitching Keras backend Tensorflow to GPUMaking Keras + Tensorflow code execution deterministic on a GPUUsing TensorFlow with Intel GPUHow to transition between offline and online learning?Multi GPU in kerasLoss plateaus off in neural style transferIssue with Custom object detection using tensorflow when Training on a single type of objectTraining Inception V3 based model using Keras with Tensorflow Backendcan't install tensorflow with gpuUsing CPU after training in GPU
$begingroup$
I want to train my custom dataset for licence plate detection. I have 2000 image for this. First, I trained my labelling dataset in Keras (TF backend) with CPU.
optimizer : Adam, learning rate : 0.01 , batch size = 64,
iteration:100000
In this case, my training period exceeded 10 days, loss is 10. When I tested the model could detect licence plates. (acc : 80%)
Then, I decided to train with gpu because of the training period is too long.
I uninstall tensorflow and I install tensorflow-gpu(1.13), Cuda(10.0) and Cudnn(7.4) and I added these codes:
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.InteractiveSession(config=config)
In this time, when I use the same values (Adam, lr=0.01, itr=100000, bs=64), loss value decreases very fast every iteration (loss begins with 210 and ends 0.000000). The training ends in four-five hours. But when I tested, my model could not detect any licence plate.
I try to change values. I did learning rate = 0.000001, iteration =3000 so that the loss is 0.7, training ends 10-20 minutes, but model detects very wrong. (and I know this number is very bad for learning rate)
My GPU : GeForce RTX 2080
How can I optimize these numbers, where is my mistake?
Thank you.
keras tensorflow gpu
$endgroup$
add a comment |
$begingroup$
I want to train my custom dataset for licence plate detection. I have 2000 image for this. First, I trained my labelling dataset in Keras (TF backend) with CPU.
optimizer : Adam, learning rate : 0.01 , batch size = 64,
iteration:100000
In this case, my training period exceeded 10 days, loss is 10. When I tested the model could detect licence plates. (acc : 80%)
Then, I decided to train with gpu because of the training period is too long.
I uninstall tensorflow and I install tensorflow-gpu(1.13), Cuda(10.0) and Cudnn(7.4) and I added these codes:
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.InteractiveSession(config=config)
In this time, when I use the same values (Adam, lr=0.01, itr=100000, bs=64), loss value decreases very fast every iteration (loss begins with 210 and ends 0.000000). The training ends in four-five hours. But when I tested, my model could not detect any licence plate.
I try to change values. I did learning rate = 0.000001, iteration =3000 so that the loss is 0.7, training ends 10-20 minutes, but model detects very wrong. (and I know this number is very bad for learning rate)
My GPU : GeForce RTX 2080
How can I optimize these numbers, where is my mistake?
Thank you.
keras tensorflow gpu
$endgroup$
3
$begingroup$
The fact you perform the training on a CPU or on a GPU wouldn't affect the results, more over from 80% to 0%. It seems to me, than when you are using the GPU, you are not testing the model with the learned weights... Are you sure you are not closing the tf.Session() or you are not restoring the weights?
$endgroup$
– ignatius
Apr 3 at 9:24
$begingroup$
thank you, I think so too, the training on a CPU or on a GPU souldn't affect the results. but according to my results it does. actually I dont understand why is the final loss value is different when training with Gpu and Cpu with the same values? i think my learning rate and batch size values are wrong, because when I changed these numbers training with gpu, my model can detect something but wrong, at least it tries. (so, the problem should not relate to weights) i dont know how to optimize learning rate and batch size training with gpu.
$endgroup$
– little_learning_rate
Apr 3 at 11:06
add a comment |
$begingroup$
I want to train my custom dataset for licence plate detection. I have 2000 image for this. First, I trained my labelling dataset in Keras (TF backend) with CPU.
optimizer : Adam, learning rate : 0.01 , batch size = 64,
iteration:100000
In this case, my training period exceeded 10 days, loss is 10. When I tested the model could detect licence plates. (acc : 80%)
Then, I decided to train with gpu because of the training period is too long.
I uninstall tensorflow and I install tensorflow-gpu(1.13), Cuda(10.0) and Cudnn(7.4) and I added these codes:
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.InteractiveSession(config=config)
In this time, when I use the same values (Adam, lr=0.01, itr=100000, bs=64), loss value decreases very fast every iteration (loss begins with 210 and ends 0.000000). The training ends in four-five hours. But when I tested, my model could not detect any licence plate.
I try to change values. I did learning rate = 0.000001, iteration =3000 so that the loss is 0.7, training ends 10-20 minutes, but model detects very wrong. (and I know this number is very bad for learning rate)
My GPU : GeForce RTX 2080
How can I optimize these numbers, where is my mistake?
Thank you.
keras tensorflow gpu
$endgroup$
I want to train my custom dataset for licence plate detection. I have 2000 image for this. First, I trained my labelling dataset in Keras (TF backend) with CPU.
optimizer : Adam, learning rate : 0.01 , batch size = 64,
iteration:100000
In this case, my training period exceeded 10 days, loss is 10. When I tested the model could detect licence plates. (acc : 80%)
Then, I decided to train with gpu because of the training period is too long.
I uninstall tensorflow and I install tensorflow-gpu(1.13), Cuda(10.0) and Cudnn(7.4) and I added these codes:
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.InteractiveSession(config=config)
In this time, when I use the same values (Adam, lr=0.01, itr=100000, bs=64), loss value decreases very fast every iteration (loss begins with 210 and ends 0.000000). The training ends in four-five hours. But when I tested, my model could not detect any licence plate.
I try to change values. I did learning rate = 0.000001, iteration =3000 so that the loss is 0.7, training ends 10-20 minutes, but model detects very wrong. (and I know this number is very bad for learning rate)
My GPU : GeForce RTX 2080
How can I optimize these numbers, where is my mistake?
Thank you.
keras tensorflow gpu
keras tensorflow gpu
asked Apr 3 at 9:11
little_learning_ratelittle_learning_rate
82
82
3
$begingroup$
The fact you perform the training on a CPU or on a GPU wouldn't affect the results, more over from 80% to 0%. It seems to me, than when you are using the GPU, you are not testing the model with the learned weights... Are you sure you are not closing the tf.Session() or you are not restoring the weights?
$endgroup$
– ignatius
Apr 3 at 9:24
$begingroup$
thank you, I think so too, the training on a CPU or on a GPU souldn't affect the results. but according to my results it does. actually I dont understand why is the final loss value is different when training with Gpu and Cpu with the same values? i think my learning rate and batch size values are wrong, because when I changed these numbers training with gpu, my model can detect something but wrong, at least it tries. (so, the problem should not relate to weights) i dont know how to optimize learning rate and batch size training with gpu.
$endgroup$
– little_learning_rate
Apr 3 at 11:06
add a comment |
3
$begingroup$
The fact you perform the training on a CPU or on a GPU wouldn't affect the results, more over from 80% to 0%. It seems to me, than when you are using the GPU, you are not testing the model with the learned weights... Are you sure you are not closing the tf.Session() or you are not restoring the weights?
$endgroup$
– ignatius
Apr 3 at 9:24
$begingroup$
thank you, I think so too, the training on a CPU or on a GPU souldn't affect the results. but according to my results it does. actually I dont understand why is the final loss value is different when training with Gpu and Cpu with the same values? i think my learning rate and batch size values are wrong, because when I changed these numbers training with gpu, my model can detect something but wrong, at least it tries. (so, the problem should not relate to weights) i dont know how to optimize learning rate and batch size training with gpu.
$endgroup$
– little_learning_rate
Apr 3 at 11:06
3
3
$begingroup$
The fact you perform the training on a CPU or on a GPU wouldn't affect the results, more over from 80% to 0%. It seems to me, than when you are using the GPU, you are not testing the model with the learned weights... Are you sure you are not closing the tf.Session() or you are not restoring the weights?
$endgroup$
– ignatius
Apr 3 at 9:24
$begingroup$
The fact you perform the training on a CPU or on a GPU wouldn't affect the results, more over from 80% to 0%. It seems to me, than when you are using the GPU, you are not testing the model with the learned weights... Are you sure you are not closing the tf.Session() or you are not restoring the weights?
$endgroup$
– ignatius
Apr 3 at 9:24
$begingroup$
thank you, I think so too, the training on a CPU or on a GPU souldn't affect the results. but according to my results it does. actually I dont understand why is the final loss value is different when training with Gpu and Cpu with the same values? i think my learning rate and batch size values are wrong, because when I changed these numbers training with gpu, my model can detect something but wrong, at least it tries. (so, the problem should not relate to weights) i dont know how to optimize learning rate and batch size training with gpu.
$endgroup$
– little_learning_rate
Apr 3 at 11:06
$begingroup$
thank you, I think so too, the training on a CPU or on a GPU souldn't affect the results. but according to my results it does. actually I dont understand why is the final loss value is different when training with Gpu and Cpu with the same values? i think my learning rate and batch size values are wrong, because when I changed these numbers training with gpu, my model can detect something but wrong, at least it tries. (so, the problem should not relate to weights) i dont know how to optimize learning rate and batch size training with gpu.
$endgroup$
– little_learning_rate
Apr 3 at 11:06
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "557"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48501%2ftraining-model-in-kerastf-backend-with-gpu%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48501%2ftraining-model-in-kerastf-backend-with-gpu%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
$begingroup$
The fact you perform the training on a CPU or on a GPU wouldn't affect the results, more over from 80% to 0%. It seems to me, than when you are using the GPU, you are not testing the model with the learned weights... Are you sure you are not closing the tf.Session() or you are not restoring the weights?
$endgroup$
– ignatius
Apr 3 at 9:24
$begingroup$
thank you, I think so too, the training on a CPU or on a GPU souldn't affect the results. but according to my results it does. actually I dont understand why is the final loss value is different when training with Gpu and Cpu with the same values? i think my learning rate and batch size values are wrong, because when I changed these numbers training with gpu, my model can detect something but wrong, at least it tries. (so, the problem should not relate to weights) i dont know how to optimize learning rate and batch size training with gpu.
$endgroup$
– little_learning_rate
Apr 3 at 11:06