"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "bb261c5c1192585eb4b381e3d4e1b094b3fb686b"
Unverified Commit 8a2c7442 authored by Adrià Arrufat's avatar Adrià Arrufat Committed by GitHub
Browse files

Fix trainer with unsupervised loss (#2436)

* Don't try to use labels in unsupervised losses

I hope that is the right way of fixing this...

* fix it by duplicating most code in send_job (works on my machine)

I will probably need to find a way to reuse the code

* try to fix it reusing the code... not sure though

* Revert "try to fix it reusing the code... not sure though"

This reverts commit f308cac6df712da3619fb05b14f3345f0ec07b9a.

* check the type of the training label to fix the issue instead
parent b9f04fdc
...@@ -1199,6 +1199,8 @@ namespace dlib ...@@ -1199,6 +1199,8 @@ namespace dlib
const auto prev_dev = dlib::cuda::get_device(); const auto prev_dev = dlib::cuda::get_device();
const bool has_unsupervised_loss = std::is_same<no_label_type, training_label_type>::value;
double j = 0; double j = 0;
for (size_t i = 0; i < devs; ++i) for (size_t i = 0; i < devs; ++i)
...@@ -1211,7 +1213,8 @@ namespace dlib ...@@ -1211,7 +1213,8 @@ namespace dlib
if (start < stop) if (start < stop)
{ {
devices[i]->net.to_tensor(dbegin+start, dbegin+stop, job.t[i]); devices[i]->net.to_tensor(dbegin+start, dbegin+stop, job.t[i]);
job.labels[i].assign(lbegin+start, lbegin+stop); if (!has_unsupervised_loss)
job.labels[i].assign(lbegin+start, lbegin+stop);
job.have_data[i] = true; job.have_data[i] = true;
} }
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment