【发布时间】:2020-04-20 05:27:45
【问题描述】:
我有一个使用 Tensorflow 和 Jupyter 的功能设置。我已将 Tensorflow==1.14 配置为在 gpu 上运行。
现在问题: 我正在使用一个名为 DeepPavlov 的开源对话式 AI 框架。它全部启动并运行(在配置方面),但我没有太多从笔记本调用 python 的经验(或根本没有)。我可以在控制台上运行此代码,但这不是我的目标。我的问题:
我有一个普通的python代码:
from deeppavlov import build_model, configs
model = build_model(configs.squad.squad, download=True)
model(['DeepPavlov is library for NLP and dialog systems.'], ['What is DeepPavlov?'])
这是我的输出:
2020-04-20 07:08:23.478 INFO in 'deeppavlov.download'['download'] at line 117: Skipped http://files.deeppavlov.ai/deeppavlov_data/squad_model_1.4_cpu_compatible.tar.gz download because of matching hashes
2020-04-20 07:08:37.884 INFO in 'deeppavlov.download'['download'] at line 117: Skipped http://files.deeppavlov.ai/embeddings/wiki-news-300d-1M.vec download because of matching hashes
2020-04-20 07:08:38.343 INFO in 'deeppavlov.download'['download'] at line 117: Skipped http://files.deeppavlov.ai/embeddings/wiki-news-300d-1M-char.vec download because of matching hashes
2020-04-20 07:08:38.364 INFO in 'deeppavlov.models.preprocessors.squad_preprocessor'['squad_preprocessor'] at line 310: SquadVocabEmbedder: loading saved tokens vocab from C:\Users\Administrator\.deeppavlov\models\squad_model\emb\vocab_embedder.pckl
2020-04-20 07:08:39.158 INFO in 'deeppavlov.models.preprocessors.squad_preprocessor'['squad_preprocessor'] at line 310: SquadVocabEmbedder: loading saved chars vocab from C:\Users\Administrator\.deeppavlov\models\squad_model\emb\char_vocab_embedder.pckl
2020-04-20 07:08:40.599 INFO in 'deeppavlov.core.layers.tf_layers'['tf_layers'] at line 615:
Warning! tf.contrib.cudnn_rnn.CudnnCompatibleGRUCell is used. It is okay for inference mode, but if you train your model with this cell it could NOT be used with tf.contrib.cudnn_rnn.CudnnGRUCell later.
2020-04-20 07:08:41.185 INFO in 'deeppavlov.core.layers.tf_layers'['tf_layers'] at line 615:
Warning! tf.contrib.cudnn_rnn.CudnnCompatibleGRUCell is used. It is okay for inference mode, but if you train your model with this cell it could NOT be used with tf.contrib.cudnn_rnn.CudnnGRUCell later.
2020-04-20 07:08:41.520 INFO in 'deeppavlov.core.layers.tf_layers'['tf_layers'] at line 615:
Warning! tf.contrib.cudnn_rnn.CudnnCompatibleGRUCell is used. It is okay for inference mode, but if you train your model with this cell it could NOT be used with tf.contrib.cudnn_rnn.CudnnGRUCell later.
2020-04-20 07:08:41.748 INFO in 'deeppavlov.core.layers.tf_layers'['tf_layers'] at line 615:
Warning! tf.contrib.cudnn_rnn.CudnnCompatibleGRUCell is used. It is okay for inference mode, but if you train your model with this cell it could NOT be used with tf.contrib.cudnn_rnn.CudnnGRUCell later.
2020-04-20 07:09:23.205 INFO in 'deeppavlov.core.models.tf_model'['tf_model'] at line 51: [loading model from C:\Users\Administrator\.deeppavlov\models\squad_model\model]
INFO:tensorflow:Restoring parameters from C:\Users\Administrator\.deeppavlov\models\squad_model\model
[['library for NLP and dialog systems'], [14], [8040850.5]]
它正常运行,但没有给我任何交互选项,如提示或它只是停止的东西。
我的目标是获得可以输入和输出(文本等)的提示。我知道我可能在使用 python 笔记本/单元时犯了一些非常基本的错误,如果您需要更多信息,请询问。谢谢。
【问题讨论】:
标签: python python-3.x tensorflow jupyter-notebook cell