Commit e89cd5f5 authored by Cao Duc Anh's avatar Cao Duc Anh

edit somethings

parent 37027479
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 1,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -34,14 +34,23 @@ ...@@ -34,14 +34,23 @@
"config = Cfg.load_config_from_file('/home/anhcd/Projects/vivas-viet-ocr/vgg-seq2seq.yml')\n", "config = Cfg.load_config_from_file('/home/anhcd/Projects/vivas-viet-ocr/vgg-seq2seq.yml')\n",
"config['cnn']['pretrained']=False\n", "config['cnn']['pretrained']=False\n",
"config['device'] = 'cuda:0'\n", "config['device'] = 'cuda:0'\n",
"weight_path = '/tmp/vgg_seq2seq.pth'" "weight_path = '/home/anhcd/Projects/vivas-viet-ocr/weights/vetocr.pth'"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 5,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_117667/2388721513.py:5: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n",
" model.load_state_dict(torch.load(weight_path, map_location=torch.device(config['device'])))\n"
]
}
],
"source": [ "source": [
"# build model\n", "# build model\n",
"model, vocab = build_model(config)\n", "model, vocab = build_model(config)\n",
...@@ -287,7 +296,7 @@ ...@@ -287,7 +296,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 6,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -352,18 +361,15 @@ ...@@ -352,18 +361,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 7,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"ename": "", "name": "stdout",
"evalue": "", "output_type": "stream",
"output_type": "error", "text": [
"traceback": [ "(26, 91, 3)\n",
"\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n", "Result: +50-100\n"
"\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n",
"\u001b[1;31mClick <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. \n",
"\u001b[1;31mView Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details."
] ]
} }
], ],
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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