PaddlePaddle / models

Officially maintained, supported by PaddlePaddle, including CV, NLP, Speech, Rec, TS, big models and so on.
Apache License 2.0
6.9k stars 2.91k forks source link

video_tag Out of memory error #5309

Open Jasonxgw opened 3 years ago

Jasonxgw commented 3 years ago

1.运行此代码时 image

2.报了以下错误 [2021-05-18 13:49:17,554] [ WARNING] - The _initialize method in HubModule will soon be deprecated, you can use the init() to handle the initialization of the object 2021-05-18 13:49:24,454 - INFO - load extractor weights from C:\Users\Administrator.paddlehub\modules\videotag_tsn_lstm\weights\tsn [INFO 2021-05-18 13:49:24,454 module.py:87] load extractor weights from C:\Users\Administrator.paddlehub\modules\videotag_tsn_lstm\weights\tsn 2021-05-18 13:49:25,316 - INFO - load lstm weights from C:\Users\Administrator.paddlehub\modules\videotag_tsn_lstm\weights\attention_lstm [INFO 2021-05-18 13:49:25,316 module.py:117] load lstm weights from C:\Users\Administrator.paddlehub\modules\videotag_tsn_lstm\weights\attention_lstm Traceback (most recent call last): File "C:/Users/Administrator/Desktop/douyin/1.py", line 9, in top_k=10) # 返回预测结果的前k个,默认为10 File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\paddlehub\compat\paddle_utils.py", line 220, in runner return func(*args, *kwargs) File "C:\Users\Administrator.paddlehub\modules\videotag_tsn_lstm\module.py", line 188, in classify scope=self.extractor_scope) File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\paddle\fluid\executor.py", line 1110, in run six.reraise(sys.exc_info()) File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\six.py", line 719, in reraise raise value File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\paddle\fluid\executor.py", line 1108, in run return_merged=return_merged) File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\paddle\fluid\executor.py", line 1238, in _run_impl use_program_cache=use_program_cache) File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\paddle\fluid\executor.py", line 1328, in _run_program [fetch_var_name]) RuntimeError: ResourceExhaustedError:

Out of memory error on GPU 0. Cannot allocate 918.750244MB memory on GPU 0, available memory is only 594.612109MB.

Please check whether there is any other process using GPU 0.

  1. If yes, please stop them, or start PaddlePaddle on another GPU.
  2. If no, please decrease the batch size of your model.

    (at D:\v2.0.2\paddle\paddle\fluid\memory\allocation\cuda_allocator.cc:69)

W0518 13:49:20.264742 11740 device_context.cc:362] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 11.0, Runtime API Version: 10.0 W0518 13:49:20.280762 11740 device_context.cc:372] device: 0, cuDNN Version: 7.4. W0518 13:49:39.900574 11740 operator.cc:206] batch_norm raises an exception struct paddle::memory::allocation::BadAlloc, ResourceExhaustedError:

Out of memory error on GPU 0. Cannot allocate 918.750244MB memory on GPU 0, available memory is only 594.612109MB.

Please check whether there is any other process using GPU 0.

  1. If yes, please stop them, or start PaddlePaddle on another GPU.
  2. If no, please decrease the batch size of your model.

    (at D:\v2.0.2\paddle\paddle\fluid\memory\allocation\cuda_allocator.cc:69)

Jasonxgw commented 3 years ago

gpu 1050ti 4g 显存

pangyoki commented 3 years ago

你好,把batch size设小一点可以吗?

Jasonxgw commented 3 years ago

没发现有batch_size 这个参数