faustomorales / keras-ocr

A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
https://keras-ocr.readthedocs.io/
MIT License
1.38k stars 355 forks source link

Error what(): std::bad_alloc when trying https://github.com/faustomorales/keras-ocr#Using #106

Closed vanchung1995 closed 4 years ago

vanchung1995 commented 4 years ago

It raise error when I try to run https://github.com/faustomorales/keras-ocr#Using

Looking for /home/nghiacv/.keras-ocr/craft_mlt_25k.h5
2020-08-12 16:39:00.748298: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-08-12 16:39:00.770506: E tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: CUDA_ERROR_UNKNOWN: unknown error
2020-08-12 16:39:00.770549: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (LAP60377): /proc/driver/nvidia/version does not exist
2020-08-12 16:39:00.770863: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-08-12 16:39:00.797939: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 1800000000 Hz
2020-08-12 16:39:00.798563: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f5294000b20 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-08-12 16:39:00.798592: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
WARNING:tensorflow:From /home/nghiacv/.local/lib/python3.6/site-packages/tensorflow/python/keras/backend.py:5871: sparse_to_dense (from tensorflow.python.ops.sparse_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Create a `tf.sparse.SparseTensor` and use `tf.sparse.to_dense` instead.
Provided alphabet does not match pretrained alphabet. Using backbone weights only.
Looking for /home/nghiacv/.keras-ocr/crnn_kurapan_notop.h5
2020-08-12 16:39:06.444293: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 989331456 exceeds 10% of free system memory.
2020-08-12 16:39:07.329766: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 989331456 exceeds 10% of free system memory.
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
faustomorales commented 4 years ago

Please provide exactly the code you used (especially if you switch the images from the ones in the README to your own) and information about your environment (RAM, CPU, OS, TensorFlow version). Those two things will help folks reproduce and diagnose. Thanks!

vanchung1995 commented 4 years ago

I realized that when I restarted my computer, It ran ok. So, maybe Ram issue raised it. Thanks so much