You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.
You must be retraining for less then 5 classes, then this diff should work for you:
diff --git a/train.lua b/train.lua
index 9f43e0b..a21f1d2 100644
--- a/train.lua
+++ b/train.lua
@@ -134,7 +134,7 @@ function Trainer:computeScore(output, target, nCrops)
-- Coputes the top1 and top5 error rate
local batchSize = output:size(1)
- local _ , predictions = output:float():topk(5, 2, true, true) -- descending
+ local _ , predictions = output:float():topk(math.min(5, output:size(2)), 2, true, true) -- descending
-- Find which predictions match the target
local correct = predictions:eq(
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Hi, @zpao @iassael @maraoz @achao @gfosco
I have met this error:
./train.lua:137: bad argument #1 to 'topk' (k not in range for dimension
What's wrong with me?
Thanks at any rate...
The text was updated successfully, but these errors were encountered: