mirror of
https://github.com/clearml/clearml
synced 2025-03-03 10:42:00 +00:00
Minor edit when training with a custom dataset (#484)
When we want to train a custom dataset, the code should have the flexibility to accommodate variable number of classes.
This commit is contained in:
parent
ca70f0a6f6
commit
dae1a1d112
@ -293,8 +293,8 @@
|
||||
"source": [
|
||||
"def test(model, epoch):\n",
|
||||
" model.eval()\n",
|
||||
" class_correct = list(0. for i in range(10))\n",
|
||||
" class_total = list(0. for i in range(10))\n",
|
||||
" class_correct = list(0. for i in range(len(classes)))\n",
|
||||
" class_total = list(0. for i in range(len(classes)))\n",
|
||||
" with torch.no_grad():\n",
|
||||
" for idx, (sounds, sample_rate, inputs, labels) in enumerate(test_loader):\n",
|
||||
" inputs = inputs.to(device)\n",
|
||||
|
Loading…
Reference in New Issue
Block a user