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

example_keras_mobilenet.py exits with ValueError: low >= high #2

Closed
alexander-sony opened this issue Oct 28, 2021 · 0 comments · Fixed by #3
Closed

example_keras_mobilenet.py exits with ValueError: low >= high #2

alexander-sony opened this issue Oct 28, 2021 · 0 comments · Fixed by #3
Assignees
Labels
bug Something isn't working

Comments

@alexander-sony
Copy link
Contributor

Failed to run example_keras_mobilenet.py

Below the output. Further down I list my pip list. I'm running with python 3.8. I installed the package simply with pip install . (after having commented out the argparse stuff in setup.py and setting version to 0.0).

(.venv) l1000323954@senor0lun1xsc01:~/github/model_optimization_86874d7$ python tutorials/example_keras_mobilenet.py 
2021-10-28 16:38:33.768937: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-10-28 16:38:33.768960: 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.
Starting Scanning Disk: /path/to/images/folder
Finished Disk Scanning: Found 0 files
2021-10-28 16:38:35.330306: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcuda.so.1
2021-10-28 16:38:35.374238: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties: 
pciBusID: 0000:21:00.0 name: Quadro P400 computeCapability: 6.1
coreClock: 1.2525GHz coreCount: 2 deviceMemorySize: 1.93GiB deviceMemoryBandwidth: 29.88GiB/s
2021-10-28 16:38:35.374473: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/cv2/../../lib64:
2021-10-28 16:38:35.374626: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcublas.so.11'; dlerror: libcublas.so.11: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/cv2/../../lib64:
2021-10-28 16:38:35.374756: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcublasLt.so.11'; dlerror: libcublasLt.so.11: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/cv2/../../lib64:
2021-10-28 16:38:35.374882: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcufft.so.10'; dlerror: libcufft.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/cv2/../../lib64:
2021-10-28 16:38:35.375028: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcurand.so.10'; dlerror: libcurand.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/cv2/../../lib64:
2021-10-28 16:38:35.375216: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcusolver.so.11'; dlerror: libcusolver.so.11: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/cv2/../../lib64:
2021-10-28 16:38:35.375374: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcusparse.so.11'; dlerror: libcusparse.so.11: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/cv2/../../lib64:
2021-10-28 16:38:35.375520: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudnn.so.8'; dlerror: libcudnn.so.8: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/cv2/../../lib64:
2021-10-28 16:38:35.375545: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1766] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2021-10-28 16:38:35.376101: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-10-28 16:38:35.377124: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-10-28 16:38:35.377157: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264]      
  0%|                                                                                                                         | 0/10 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "tutorials/example_keras_mobilenet.py", line 73, in <module>
    quantized_model, quantization_info = mct.keras_post_training_quantization(model,
  File "/home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/model_compression_toolkit/keras/quantization_facade.py", line 219, in keras_post_training_quantization
    tg = _post_training_model_builder(in_model,
  File "/home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/model_compression_toolkit/keras/quantization_facade.py", line 124, in _post_training_model_builder
    mi.infer(representative_data_gen())
  File "tutorials/example_keras_mobilenet.py", line 68, in representative_data_gen
    return [image_data_loader.sample()]
  File "/home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/model_compression_toolkit/common/data_loader.py", line 102, in sample
    self._sample()
  File "/home/l1000323954/github/model_optimization_86874d7/.venv/lib/python3.8/site-packages/model_compression_toolkit/common/data_loader.py", line 85, in _sample
    index = np.random.randint(0, self.n_files - 1, self.batch_size)
  File "mtrand.pyx", line 746, in numpy.random.mtrand.RandomState.randint
  File "_bounded_integers.pyx", line 1254, in numpy.random._bounded_integers._rand_int64
ValueError: low >= high

(.venv) l1000323954@senor0lun1xsc01:~/github/model_optimization_86874d7$ pip list
Package                        Version
------------------------------ -------------------
absl-py                        0.15.0
astunparse                     1.6.3
cachetools                     4.2.4
certifi                        2021.10.8
charset-normalizer             2.0.7
constrained-model-optimization 0.0
cycler                         0.10.0
decorator                      5.1.0
dm-tree                        0.1.6
flatbuffers                    1.12
gast                           0.4.0
google-auth                    2.3.2
google-auth-oauthlib           0.4.6
google-pasta                   0.2.0
grpcio                         1.34.1
h5py                           3.1.0
idna                           3.3
imageio                        2.10.1
joblib                         1.1.0
keras-nightly                  2.5.0.dev2021032900
Keras-Preprocessing            1.1.2
kiwisolver                     1.3.2
Markdown                       3.3.4
matplotlib                     3.4.3
networkx                       2.5
numpy                          1.19.5
oauthlib                       3.1.1
opencv-python                  4.5.4.58
opt-einsum                     3.3.0
Pillow                         8.4.0
pip                            21.3.1
protobuf                       3.19.0
pyasn1                         0.4.8
pyasn1-modules                 0.2.8
pyparsing                      3.0.3
python-dateutil                2.8.2
PyWavelets                     1.1.1
requests                       2.26.0
requests-oauthlib              1.3.0
rsa                            4.7.2
scikit-image                   0.18.3
scikit-learn                   1.0.1
scipy                          1.7.1
setuptools                     56.0.0
six                            1.15.0
tensorboard                    2.7.0
tensorboard-data-server        0.6.1
tensorboard-plugin-wit         1.8.0
tensorflow                     2.5.0
tensorflow-estimator           2.5.0
tensorflow-model-optimization  0.7.0
termcolor                      1.1.0
threadpoolctl                  3.0.0
tifffile                       2021.10.12
tqdm                           4.62.3
typing-extensions              3.7.4.3
urllib3                        1.26.7
Werkzeug                       2.0.2
wheel                          0.37.0
wrapt                          1.12.1

(.venv) l1000323954@senor0lun1xsc01:~/github/model_optimization_86874d7$ python --version
Python 3.8.12
@haihabi haihabi added the bug Something isn't working label Oct 29, 2021
@reuvenperetz reuvenperetz linked a pull request Oct 31, 2021 that will close this issue
elad-c pushed a commit to elad-c/model_optimization that referenced this issue Mar 9, 2022
haihabi pushed a commit that referenced this issue Mar 9, 2022
* Add MultiHeadAttention test and support in HPTQ (substitution to simple keras layer nodes)
under debug: in back2framework Dot layer node build fails because it expects 2 inputs

* Finish MultiHeadAttention decomposition and tests

* MHA test pass for all MHA layer options

* MHA: update test

* MHA: update test classes

* fix PR comments

* fix PR comments #2

Co-authored-by: elad cohen <[email protected]>
elad-c pushed a commit that referenced this issue May 30, 2022
IdanBenAmi pushed a commit to IdanBenAmi/model_optimization that referenced this issue Aug 8, 2022
elad-c pushed a commit to elad-c/model_optimization that referenced this issue Jun 14, 2023
elad-c pushed a commit to elad-c/model_optimization that referenced this issue Aug 1, 2023
elad-c pushed a commit to elad-c/model_optimization that referenced this issue Sep 6, 2023
elad-c added a commit that referenced this issue May 9, 2024
elad-c added a commit that referenced this issue Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants