{"action":"created","issue":{"url":"https://api.github.com/repos/Conchylicultor/DeepQA/issues/23","repository_url":"https://api.github.com/repos/Conchylicultor/DeepQA","labels_url":"https://api.github.com/repos/Conchylicultor/DeepQA/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/Conchylicultor/DeepQA/issues/23/comments","events_url":"https://api.github.com/repos/Conchylicultor/DeepQA/issues/23/events","html_url":"https://github.com/Conchylicultor/DeepQA/issues/23","id":193419901,"number":23,"title":"New ckpt format name with recent TF","user":{"login":"Samurais","id":3538629,"avatar_url":"https://avatars.githubusercontent.com/u/3538629?v=3","gravatar_id":"","url":"https://api.github.com/users/Samurais","html_url":"https://github.com/Samurais","followers_url":"https://api.github.com/users/Samurais/followers","following_url":"https://api.github.com/users/Samurais/following{/other_user}","gists_url":"https://api.github.com/users/Samurais/gists{/gist_id}","starred_url":"https://api.github.com/users/Samurais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samurais/subscriptions","organizations_url":"https://api.github.com/users/Samurais/orgs","repos_url":"https://api.github.com/users/Samurais/repos","events_url":"https://api.github.com/users/Samurais/events{/privacy}","received_events_url":"https://api.github.com/users/Samurais/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-12-05T06:19:54Z","updated_at":"2016-12-08T22:08:26Z","closed_at":null,"body":"# Description\r\n\r\nTrain the model following the README, it takes two days to run for 30 epochs. After the program exit gracefully, it said -\r\n\r\n![image](https://cloud.githubusercontent.com/assets/3538629/20875255/35901592-baf4-11e6-8f8b-39f11485a24c.png)\r\n\r\nIn the ```save/``` directory, I get \r\n![image](https://cloud.githubusercontent.com/assets/3538629/20875276/5f7ca9ba-baf4-11e6-83e0-ad51e770b40f.png)\r\n\r\nSo these are the trained model.\r\n\r\nThen I copy **save/model-201612031626** to **save/model-server**. As later chatbot_website would use this folder as default model.\r\nBut it does not works. Running **python manage.py runserver** would clean the folder.\r\n\r\n```\r\nSaving dataset...\r\nLoaded: 43462 words, 186544 QA\r\nModel creation...\r\nInitialize variables...\r\nWARNING: No previous model found, but some files found at /Users/hain/chatbot_butterfly/save/model-server. Cleaning...\r\nRemoving /Users/hain/chatbot_butterfly/save/model-server/checkpoint\r\nRemoving /Users/hain/chatbot_butterfly/save/model-server/events.out.tfevents.1480764302.dagama\r\nRemoving /Users/hain/chatbot_butterfly/save/model-server/model.ckpt.data-00000-of-00001\r\nRemoving /Users/hain/chatbot_butterfly/save/model-server/model.ckpt.index\r\nRemoving /Users/hain/chatbot_butterfly/save/model-server/model.ckpt.meta\r\nRemoving /Users/hain/chatbot_butterfly/save/model-server/params.ini\r\nDaemon mode, running in background...\r\nInitializing bot...\r\n```\r\n\r\nSo, I download the **model-pretrained** data from [Google Drive](https://drive.google.com/file/d/0Bw-phsNSkq23amlSZXVqcm5oVFU/view?usp=sharing).\r\n\r\nI copy the extracted data of **model-pretrained** into **save/model-server**. The app run successfully, and I can chat with bot from web interface, which is great.\r\n\r\nAfter comparing my model data and model-pretrained, it has different file names.\r\n\r\n### save/model-201612031626 \r\n```\r\ncheckpoint  \r\nevents.out.tfevents.1480764302.dagama  \r\nmodel.ckpt.data-00000-of-00001  \r\nmodel.ckpt.index  \r\nmodel.ckpt.meta  \r\nparams.ini\r\n```\r\n\r\n### model-pretrained\r\n```\r\nmodel.ckpt  \r\nmodel.ckpt.meta  \r\nmodel_predictions.txt  \r\nparams.ini\r\n```\r\n\r\nSo I guess **model.ckpt.data-00000-of-00001** should be rename to **model.ckpt**.\r\nBut it does not work, instead, **python manage.py runserver** said -\r\n\r\n```\r\nW tensorflow/core/framework/op_kernel.cc:968] Data loss: Unable to open table file /Users/hain/chatbot_butterfly/save/model-server/mode\r\nl.ckpt: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?\r\nW tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /Users/hain/chatbot_butterfly/save/model-server/model.ckpt: Data loss:\r\n not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?\r\nW tensorflow/core/framework/op_kernel.cc:968] Data loss: Unable to open table file /Users/hain/chatbot_butterfly/save/model-server/mode\r\nl.ckpt: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?\r\nInitializing bot...\r\nWelcome to DeepQA v0.1 !\r\n\r\nTensorFlow detected: v0.11.0rc1\r\nLoading dataset from /Users/hain/chatbot_butterfly/data/samples/...\r\nLoaded: 35019 words, 139979 QA\r\nModel creation...\r\nInitialize variables...\r\nWARNING: Restoring previous model from /Users/hain/chatbot_butterfly/save/model-server/model.ckpt\r\nW tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /Users/hain/chatbot_butterfly/save/model-server/model.ckpt: Data loss:\r\n not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?\r\nW tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /Users/hain/chatbot_butterfly/save/model-server/model.ckpt: Data loss:\r\n not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?\r\nW tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /Users/hain/chatbot_butterfly/save/model-server/model.ckpt: Data loss:\r\n not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?\r\nW tensorflow/core/framework/op_kernel.cc:968] Data loss: Unable to open table file /Users/hain/chatbot_butterfly/save/model-server/mode\r\nl.ckpt: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?\r\n```\r\n\r\nSo, how to get files in **model-pretrained**'s format? Am I missing something?\r\n\r\n\r\n## Environment\r\n\r\nPython - 3.5\r\nTensorFlow - 0.11 rc1\r\n"},"comment":{"url":"https://api.github.com/repos/Conchylicultor/DeepQA/issues/comments/265870440","html_url":"https://github.com/Conchylicultor/DeepQA/issues/23#issuecomment-265870440","issue_url":"https://api.github.com/repos/Conchylicultor/DeepQA/issues/23","id":265870440,"user":{"login":"Conchylicultor","id":9047355,"avatar_url":"https://avatars.githubusercontent.com/u/9047355?v=3","gravatar_id":"","url":"https://api.github.com/users/Conchylicultor","html_url":"https://github.com/Conchylicultor","followers_url":"https://api.github.com/users/Conchylicultor/followers","following_url":"https://api.github.com/users/Conchylicultor/following{/other_user}","gists_url":"https://api.github.com/users/Conchylicultor/gists{/gist_id}","starred_url":"https://api.github.com/users/Conchylicultor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Conchylicultor/subscriptions","organizations_url":"https://api.github.com/users/Conchylicultor/orgs","repos_url":"https://api.github.com/users/Conchylicultor/repos","events_url":"https://api.github.com/users/Conchylicultor/events{/privacy}","received_events_url":"https://api.github.com/users/Conchylicultor/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T22:08:26Z","updated_at":"2016-12-08T22:08:26Z","body":"Apparently, TF recently introduced a new checkpoint format (saver V2). A quick fix to use the old format with tf 0.12 is to create the saver with the `write_version` flag:\r\n\r\n```\r\nsaver = tf.train.Saver(write_version=tf.train.SaverDef.V1)\r\n```\r\n"}}
{"actor":{"display_login":"Conchylicultor"}}