Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法训练,报错进程已结束,退出代码为 -1073741819 (0xC0000005) #345

Open
reporter-law opened this issue May 21, 2021 · 6 comments

Comments

@reporter-law
Copy link

reporter-law commented May 21, 2021

提问时请尽可能提供如下信息:

进程已结束,退出代码为 -1073741819 (0xC0000005)

基本信息

  • 你使用的操作系统 windows:
  • 你使用的Python版本: Python3.6
  • 你使用的**tensorflow **版本: tensorflow 1.15.0
  • 你使用的Keras版本: Keras 2.2.4
  • 你使用的bert4keras版本: bert4keras 0.10.6
  • 你使用纯keras: 纯keras
  • 你加载的预训练模型:chinese_bert_chinese_wwm_L-12_H-768_A-12

核心代码

# bert4keras examples task_relation_extraction.py。
# 。

输出信息

# 请在此处贴上你的调试输出
2021-05-21 12:48:49.892875: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2021-05-21 12:48:49.893350: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Using TensorFlow backend.
WARNING:tensorflow:From C:\Users\lenovo\.conda\envs\Miniconda\lib\site-packages\keras\backend\tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From C:\Users\lenovo\.conda\envs\Miniconda\lib\site-packages\keras\backend\tensorflow_backend.py:4185: The name tf.truncated_normal is deprecated. Please use tf.random.truncated_normal instead.

WARNING:tensorflow:From C:\Users\lenovo\.conda\envs\Miniconda\lib\site-packages\keras\backend\tensorflow_backend.py:131: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING:tensorflow:From C:\Users\lenovo\.conda\envs\Miniconda\lib\site-packages\keras\backend\tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

WARNING:tensorflow:From C:\Users\lenovo\.conda\envs\Miniconda\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
进程已结束,退出代码为 -1073741819 (0xC0000005)

自我尝试

不管什么问题,请先尝试自行解决,“万般努力”之下仍然无法解决再来提问。此处请贴上你的努力过程。

@bojone
Copy link
Owner

bojone commented May 21, 2021

感觉像是机器资源不够导致的退出(内存不够,cpu不够之类的,我也不确定)

@reporter-law
Copy link
Author

reporter-law commented May 21, 2021

我看了cpu,内存的监测,运行的时候没有特别增长,调试的时候发现在

核心代码

# bert = build_transformer_model(
    config_path=config_path,
    checkpoint_path=checkpoint_path,
    return_keras_model=False,
)

出现停止,之前的print可以正常输出,但是这之后无法打印输出,不知道是不是这bert的问题
之后尝试了例子中的分词task_sequence_labeling_cws_crf.py:任务示例,通过BERT + CRF来做中文分词。
也是这个问题

@bojone
Copy link
Owner

bojone commented May 24, 2021

那就不清楚了。

看开头Could not load dynamic library 'cudart64_100.dll',是不是没有gpu环境而装了gpu版tf?换用cpu版tf试试~

@xz23333
Copy link

xz23333 commented Oct 15, 2021

我在pretraining.py也遇到了 Process finished with exit code -1073741819 (0xC0000005) 这个问题。
【PyCharm答疑】Process finished with exit code - 知乎 得出可能是h5py的版本不匹配问题。
我安装的版本:
你使用的Python版本: 3.7
你使用的Tensorflow版本: 1.15.4
你使用的Keras版本: 2.3.1
h5py:2.8.0
根据 model.save 的问题 · Issue #246 · bojone/bert4keras,我把tensorflow的版本升到了2.3.0,解决√。

@yetzi1975
Copy link

请问有解决方案吗?
我运行basic_extract_features.py遇到了同样的问题:Process finished with exit code -1073741819 (0xC0000005)
Python版本: 3.7.13
Tensorflow版本: 1.15.0
Keras版本: 2.3.1
h5py:3.7.0
换了两台设备都报这个错。

@liwei413519
Copy link

可以试一试这样:
import tensorflow as tf
checkpoint_path = tf.train.latest_checkpoint(r'./model/bert_model.ckpt')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants