Tag Archives: paddlepaddle

[Solved] PaddleX ERROR: Unexpected BUS error encountered in DataLoader worker

ERROR: Unexpected BUS error encountered in DataLoader worker. This might be caused by insufficient shared memory (shm),

reason

Set the number of num_workers is larger than the actual situation

Solution:

Change num_workers  to 0, or half the number of cores. It can also be configured not to let the system automatically obtain

The error message is as follows:

ERROR: Unexpected BUS error encountered in DataLoader worker. This might be caused by insufficient shared memory (shm), please check whether use_shared_memory is set and storage space in /dev/shm is enough
Traceback (most recent call last):
  File "train.py", line 72, in <module>
    use_vdl=True)  # 其用visuadl进行可视化训练记录
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlex/cv/models/detector.py", line 334, in train
    use_vdl=use_vdl)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddlex/cv/models/base.py", line 333, in train_loop
    Exception in thread Thread-3:
Traceback (most recent call last):
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/dataloader_iter.py", line 583, in _get_data
    data = self._data_queue.get(timeout=self._timeout)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/multiprocessing/queues.py", line 105, in get
    raise Empty
_queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/dataloader_iter.py", line 505, in _thread_loop
    batch = self._get_data()
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/dataloader_iter.py", line 599, in _get_data
    "pids: {}".format(len(failed_workers), pids))
RuntimeError: DataLoader 1 workers exit unexpectedly, pids: 4652
for step, data in enumerate(self.train_data_loader()):

  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/dataloader_iter.py", line 697, in __next__
    data = self._reader.read_next_var_list()
SystemError: (Fatal) Blocking queue is killed because the data reader raises an exception.
  [Hint: Expected killed_ != true, but received killed_:1 == true:1.] (at /paddle/paddle/fluid/operators/reader/blocking_queue.h:166)

[Solved] Pycharm paddle Error: Error: (External) CUDA error(35), CUDA driver version is insufficient for CUDA

Error content:

UserWarning: You are using GPU version Paddle, but your CUDA device is not set properly. CPU device will be used by default.
  "You are using GPU version Paddle, but your CUDA device is not set properly. CPU device will be used by default."
Traceback (most recent call last):
  File "D:/python-pic/exm4/fruits/01_fruits.py", line 178, in <module>
    place=fluid.CUDAPlace(0)#GPU上执行
OSError: (External) CUDA error(35), CUDA driver version is insufficient for CUDA runtime version. 
  [Hint: 'cudaErrorInsufficientDriver'. This indicates that the installed NVIDIA CUDA driver is older than the CUDA runtime library. This is not a supported configuration.Users should install an updated NVIDIA display driver to allow the application to run.] (at ..\paddle\fluid\platform\gpu_info.cc:108)

reason:

This indicates that the installed NVIDIA CUDA driver is older than the CUDA runtime library. This is not a supported configuration.Users should install an updated NVIDIA display driver to allow the application to run.

Solution: update the graphics card driver

[Solved] paddle:FatalError: `Segmentation fault` is detected by the operating system.

Question

When using the paddle framework for relevant model training, an error is reported when using the GPU:

C++ Traceback (most recent call last):
--------------------------------------
0 std::thread::_Impl<std::_Bind_simple<ThreadPool::ThreadPool(unsigned long)::{lambda()#1} ()> >::_M_run()
1 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)
2 paddle::framework::SignalHandle(char const*, int)
3 paddle::platform::GetCurrentTraceBackString[abi:cxx11]()

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
[TimeInfo: *** Aborted at 1639543591 (unix time) try "date -d @1639543591" if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 168238 (TID 0x7fc05d8c5700) from PID 0 ***]

edition:

python=3.8 paddlepaddle-gpu=2.2.1 cuda=10.1 cudnn=7.6

Check the issue and find that many of these situations occur. Make a record here

Solution:

Reinstall using CONDA.

Execute command:

conda install paddlepaddle-gpu==2.2.1 cudatoolkit=10.1 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/

[Solved] error: this statement may fall through [-Werror=implicit-fallthrough=]

/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:681:5: note: here
     case 'e':
     ^~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:686:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
       out.setf(std::ios::uppercase);
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:687:5: note: here
     case 'f':
     ^~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:691:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
       out.setf(std::ios::uppercase);
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:692:5: note: here
     case 'g':
     ^~~~
In file included from /home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/printf.h:76:0,
                 from /home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/platform/enforce.h:40,
                 from /home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/framework/threadpool.h:25,
                 from /home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/framework/threadpool.cc:15:
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h: In function ‘const char* paddle::string::tinyformat::detail::streamStateFromFormat(std::ostream&, bool&, int&, const char*, const paddle::string::tinyformat::detail::FormatArg*, int&, int)’:
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:673:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
       out.setf(std::ios::uppercase);
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:674:5: note: here
     case 'x':
     ^~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:680:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
       out.setf(std::ios::uppercase);
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

 

Solution:

Add the following line in the CMakeList.txt file:
set(CMAKE_CXX_FLAGS “-Wno-implicit-fallthroughs”)

How to Solve paddleOCR recognition of curved text Error

Lower the version of paddlepaddle from 2.2.0 to 2.1.3 and you’re done. Note that there are two commands to run:

python  tools/export_model.py -c configs/det/det_r50_vd_sast_totaltext.yml -o Global.checkpoints="./models/sast_r50_vd_total_text/best_accuracy" Global.save_inference_dir="./inference/det_sast_tt"

python3 tools/infer/predict_det.py --det_algorithm="SAST" --image_dir="./doc/imgs_en/img_10.jpg" --det_model_dir="./inference/det_sast_tt/" --det_sast_polygon=True --use_gpu=False

 

/home/PaddleOCR {release/2.3} python3 tools/infer/predict_det.py --det_algorithm="SAST" --image_dir="./doc/imgs_en/img623.jpg" --det_model_dir="./inference/det_sast_tt/" --det_sast_polygon=True --use_gpu=False
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
/usr/local/lib/python3.8/site-packages/setuptools/depends.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
---    Fused 0 subgraphs into layer_norm op.
---    fused 0 pairs of fc gru patterns
Traceback (most recent call last):
  File "tools/infer/predict_det.py", line 242, in <module>
    res = text_detector(img)
  File "tools/infer/predict_det.py", line 218, in __call__
    post_result = self.postprocess_op(preds, shape_list)
  File "/home/PaddleOCR/ppocr/postprocess/sast_postprocess.py", line 341, in __call__
    poly_list = self.detect_sast(
  File "/home/PaddleOCR/ppocr/postprocess/sast_postprocess.py", line 237, in detect_sast
    instance_count, instance_label_map = self.cluster_by_quads_tco(
  File "/home/PaddleOCR/ppocr/postprocess/sast_postprocess.py", line 164, in cluster_by_quads_tco
    pred_tc = xy_text - tco
ValueError: operands could not be broadcast together with shapes (43093,2) (43093,8)

 

 

How to Solve QGIS installation paddy GPU error

QGIS installation paddy GPU error

Error content

Use the following code to check whether the paddle GPU is installed successfully

import paddle
paddle.utils.run_check()

Get the following error reports

RuntimeError: (PreconditionNotMet) The third-party dynamic library (cublas64_102.dll;cublas64_10.dll) that Paddle depends on is not configured correctly. (error code is 126)
  Suggestions:
  1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure third-party dynamic library environment variables as follows:
  - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`
  - Windows: set PATH by `set PATH=XXX; (at C:\home\workspace\Paddle_release\paddle\fluid\platform\dynload\dynamic_loader.cc:265)

It is found that other CONDA environments can be used normally, CUDA installation and environment variable configuration are correct, and the environment variable is checked in QGIS. It is found that there is no C: \program files\NVIDIA GPU computing toolkit\CUDA\v10.2\bin in path.

Solution:

For the desktop, you can add C:\program files\NVIDIA GPU computing toolkit\CUDA\v10.2\bin
after the path in QGIS\bin\qgis-ltr-bin.env. For plug-ins developed in vscode, you can add o4w in the same folder, Change set path to set path =% osgeo4w in env.bat_ROOT%\bin;% WINDIR%\system32;% WINDIR%;% WINDIR%\system32\WBem;% CUDA_BIN_PATH%

Error in installing paddlenlp on pip on Windows

1. PIP installation paddlenlp reports an error

An error is reported when PIP installs paddlenlp on windows, as follows:

 distutils.errors.DistutilsError: Command '['C:\\Users\\yuanyangping\\.conda\\envs\\yyp_paddle\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\YUANYA~1\\AppData\\Local\\Temp\\tmphix_2c5i', '--quiet', 'setuptools_scm']' returned non-zero exit status 1.

Some methods to solve the problem are queried, but they are not effective, so they are not listed one by one.

2. Solutions

Pay attention to one detail. It is normal to download paddlenlp, but an error is reported only after downloading seqeval, as follows:

Collecting paddlenlp
  Downloading http://mirrors.aliyun.com/pypi/packages/b0/7d/6c24cda54d018d350ee342f715523ade7871660444ed95f3d3e753d6f388/paddlenlp-2.0.8-py3-none-any.whl (571 kB)
     |████████████████████████████████| 571 kB 467 kB/s
Collecting seqeval
  Downloading http://mirrors.aliyun.com/pypi/packages/9d/2d/233c79d5b4e5ab1dbf111242299153f3caddddbb691219f363ad55ce783d/seqeval-1.2.2.tar.gz (43 kB)
     |████████████████████████████████| 43 kB 656 kB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\yuanyangping\.conda\envs\yyp_paddle\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\YUANYA~1\\AppData\\Local\\Temp\\pip-install-n4_d0gwa\\seqeval_6f8ecdc805df4aa092ecc3df7994196f\\setup.py'"'"'; __file__='"'"'C:\\Users\\YUANYA~1\\AppData\\Local\\Temp\\pip-install-n4_d0gwa\\seqeval_6f8ecdc805df4aa092ecc3df7994196f\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\YUANYA~1\AppData\Local\Temp\pip-pip-egg-info-zp58k0dh'

Therefore, can you install seqeval first and then paddlenlp, and execute two commands in succession, as follows:

pip install seqeval
pip install paddlenlp

Then paddlenlp is successfully installed
If an error is still reported, specify the version of seqeval as 0.0.3

3. Extension

The above reason should be that there is a problem with the configuration information when downloading and installing seqeval
therefore, if similar error reports occur when installing other software, you can install the software where the error is reported first, and then install the main software you want to install.

PaddlePaddle:Process finished with exit code -1073741819 (0xC0000005)

Paddleocr training ICDAR training set, can only run one epoch, no obvious error, no memory abnormal situation. Occasionally see – 1073741819.

The solution is to reduce the version of SciPy to 1.3.1, or 1.4.

Reference (2 messages) paddlepaddle: process finished with exit code – 1073741819 (0xc0000005)_ Big big__ CSDN blog