ronylpatil / Covid-19-Detection-using-Deep-Hybrid-Learning

Image classification using XGBOOST by extracting features using VGG16 ImageNet. This project explains the process of using XGBOOST for image classification using pre-trained weights (VGG16) as feature extractors.
MIT License
5 stars 6 forks source link

wich step missing here? #1

Open johnfelipe opened 2 years ago

johnfelipe commented 2 years ago

SNAG-0860

git clone https://github.com/ronylpatil/Covid-19-Detection-using-Deep-Hybrid-Learning.git
cd Covid-19-Detection-using-Deep-Hybrid-Learning/
pip install xgboost
streamlit run webapp3.py
johnfelipe commented 2 years ago
root@eh682214710:~/Covid-19-Detection-using-Deep-Hybrid-Learning# streamlit run webapp3.py
2022-01-11 00:09:56.376765: 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
2022-01-11 00:09:56.376803: 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.

  You can now view your Streamlit app in your browser.

  Network URL: http://10.1.0.4:8501
  External URL: http://20.122.93.89:8501

2022-01-11 00:14:36.425942: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2022-01-11 00:14:36.426000: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
2022-01-11 00:14:36.426034: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (eh682214710): /proc/driver/nvidia/version does not exist
2022-01-11 00:14:36.426253: I tensorflow/core/platform/cpu_feature_guard.cc:151] 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.
Downloading data from https://storage.googleapis.com/tensorflow/keras-applications/vgg16/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5
58900480/58889256 [==============================] - 0s 0us/step
2022-01-11 00:14:37.127 Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/streamlit/script_runner.py", line 354, in _run_script
    exec(code, module.__dict__)
  File "/root/Covid-19-Detection-using-Deep-Hybrid-Learning/webapp3.py", line 91, in <module>
    main()
  File "/root/Covid-19-Detection-using-Deep-Hybrid-Learning/webapp3.py", line 30, in main
    result = predict_class(image)
  File "/root/Covid-19-Detection-using-Deep-Hybrid-Learning/webapp3.py", line 54, in predict_class
    feature_extractor = vggmodel.predict(test_image)
  File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/func_graph.py", line 1129, in autograph_handler
    raise e.ag_error_metadata.to_exception(e)
ValueError: in user code:

    File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1621, in predict_function  *
        return step_function(self, iterator)
    File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1611, in step_function  **
        outputs = model.distribute_strategy.run(run_step, args=(data,))
    File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1604, in run_step  **
        outputs = model.predict_step(data)
    File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1572, in predict_step
        return self(x, training=False)
    File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
        raise e.with_traceback(filtered_tb) from None
    File "/usr/local/lib/python3.8/dist-packages/keras/engine/input_spec.py", line 263, in assert_input_compatibility
        raise ValueError(f'Input {input_index} of layer "{layer_name}" is '

    ValueError: Input 0 of layer "vgg16" is incompatible with the layer: expected shape=(None, 256, 256, 3), found shape=(None, 256, 256, 9)

still with error how solve?

ronylpatil commented 2 years ago

Because the final channel of your dataset is (256, 256, 9), I believe you should first verify whether your data is in RGB format or not. This suggests that the picture is already in three channels, and you are again transforming it into three channels during preprocessing.

ronylpatil commented 2 years ago

Check out my Telegram AI Chatbot repository. In that repository, I have tackled that problem. That code will undoubtedly be of assistance to you. Did you really like it? and sorry for the late reply😑.

johnfelipe commented 2 years ago

Pls share link for new repository, tnks

ronylpatil commented 2 years ago

https://github.com/ronylpatil/Intelligent-Telegram-Chatbot-using-AI Checkout : AI Bot Folder -> bot.py file -> line no. 41 onwards