"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "5afc2b60cd1c555c33e2df7caa93372b5c21a3e8"
Unverified Commit f6bc4e4b authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[doc] do not save model in tutorial (#6614)

parent 0a8c533a
......@@ -4,8 +4,7 @@
"metadata": {
"colab": {
"private_outputs": true,
"provenance": [],
"authorship_tag": "ABX9TyMWE8zjXNzesRPRk8RK7jsv"
"provenance": []
},
"kernelspec": {
"name": "python3",
......@@ -313,8 +312,6 @@
"source": [
"import tqdm\n",
"\n",
"best_accuracy = 0\n",
"best_model_path = \"model.pt\"\n",
"for epoch in range(10):\n",
" model.train()\n",
"\n",
......@@ -353,9 +350,6 @@
" labels = np.concatenate(labels)\n",
" accuracy = sklearn.metrics.accuracy_score(labels, predictions)\n",
" print(\"Epoch {} Validation Accuracy {}\".format(epoch, accuracy))\n",
" if best_accuracy < accuracy:\n",
" best_accuracy = accuracy\n",
" torch.save(model.state_dict(), best_model_path)\n",
"\n",
" # Note that this tutorial do not train the whole model to the end.\n",
" break"
......@@ -378,4 +372,4 @@
}
}
]
}
}
\ No newline at end of file
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