Доброго времени суток!
Я дообучил rusentiment conv bert и сохранил модель. Теперь хочу поднять апи и использовать модель в интеграций с фронтендом, но код ниже выдает ошибку
!python -m deeppavlov riseapi /content/test.json
`2021-06-07 23:48:12.504838: W tensorflow/core/common_runtime/bfc_allocator.cc:424] ****************************xxxxxxxxxxxxxxxxxxxx****************************xxxxxxxxxxxxxxxxxxxx***_
2021-06-07 23:48:12.504883: W tensorflow/core/framework/op_kernel.cc:1628] OP_REQUIRES failed at constant_op.cc:77 : Resource exhausted: OOM when allocating tensor of shape [119547,768] and type float
2021-06-07 23:48:12.504940: E tensorflow/core/common_runtime/executor.cc:642] Executor failed to create kernel. Resource exhausted: OOM when allocating tensor of shape [119547,768] and type float
[[{{node Optimizer/Optimizer/bert/embeddings/word_embeddings/AdamWeightDecayOptimizer/Initializer/zeros}}]]
2021-06-07 23:48:12.521 ERROR in 'deeppavlov.core.common.params'['params'] at line 112: Exception in <class 'deeppavlov.models.bert.bert_classifier.BertClassifierModel'>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
return fn(*args)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
target_list, run_metadata)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor of shape [119547,768] and type float
[[{{node Optimizer/Optimizer/bert/embeddings/word_embeddings/AdamWeightDecayOptimizer/Initializer/zeros}}]]
Вариант с уменшением batch size подойдет так как модель уже натренирована и готова к пользованию.
Я также пробовал так:
from deeppavlov.utils.server import start_model_server
start_model_server(mix_model)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-7-30ecd7d9cf91> in <module>()
----> 1 start_model_server(mix_model)
4 frames
/usr/lib/python3.7/asyncio/base_events.py in _check_runnung(self)
521 def _check_runnung(self):
522 if self.is_running():
--> 523 raise RuntimeError('This event loop is already running')
524 if events._get_running_loop() is not None:
525 raise RuntimeError(
RuntimeError: This event loop is already running
Как решить данную проблему?