title: Why streamlit is throwing out "ValueError: No model found in config file"?
body: <pre><code>`ValueError: No model found in config file.
  
  Traceback:
  File &quot;c:\users\makje\anaconda3\envs\tensorflow\lib\site-packages\streamlit\script_runner.py&quot;, line 338, in _run_script
  exec(code, module.__dict__)
  
  File &quot;C:\Users\makje\Documents\CODE\Python\A.I.(intern)\major.py&quot;, line 8, in &lt;module&gt;
  model = tf.keras.models.load_model(&quot;C:\\Users\\makje\\Documents\\CODE\\Python\\A.I(intern)\\malay_model.hdf5&quot;)
  
  File &quot;c:\users\makje\anaconda3\envs\tensorflow\lib\site- packages\tensorflow\python\keras\saving\save.py&quot;, line 182, in load_model
  return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
  
  File &quot;c:\users\makje\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py&quot;, line 175, in load_model_from_hdf5
  raise ValueError('No model found in config file.')`
  </code></pre>
  <p>These are the things that need to know before going to any conclusion.</p>
  <ol>
  <li>I've created a model inside a jupyter notebook.</li>
  <li>It's 100% working(accurate prediction).</li>
  <li>Model object is saved locally inside my 'C' drive.</li>
  <li>I've created a streamlit web app inside a jupyter notebook</li>
  </ol>
  <p><strong>Given a streamlit code below</strong>\</p>
  <pre><code>%%writefile dvc.py
  import streamlit as st
  import tensorflow as tf
  import numpy as np
  import streamlit as st 
  from PIL import Image
  import requests
  from io import BytesIO
  
  st.set_option('deprecation.showfileUploaderEncoding', False)
  st.title(&quot;Dogs and Cats Classification&quot;)
  st.text(&quot;Provide an Image for image classification&quot;)
  
  @st.cache(allow_output_mutation=True)
  def load_model():
    model = tf.keras.models.load_model('C:\\Users\\makje\\Documents\\CODE\\Python\\A.I(intern)\\model.h5')
    return model
  
  with st.spinner('Loading Model Into Memory....'):
    model = load_model()
  
  def scale(image):
    image = tf.cast(image, tf.float32)
    image /= 255.0
  
    return tf.image.resize(image,[128,128])
  
  def decode_img(image):
    img = tf.image.decode_jpeg(image, channels=3)
    img = scale(img)
    return np.expand_dims(img, axis=0)
  
  path = st.text_input('Enter Image URL to classify...','https://www.thesprucepets.com/thmb/fkocatcypSHCKeezdfPdGXOi3FU=/1333x1000/smart/filters:no_upscale()/top-friendliest-dog-breeds-4691511_hero-5c6a918dcf56409c888d78b0fac82d18.jpg')
  
  if path is not None:
    content = requests.get(path).content
  
    st.write(&quot;Predicted Class&quot;)
    with st.spinner('Classifying....'):
      label = np.argmax(model.predict(decode_img(content)),axis=1)
      st.write(classes[label[0]])
      
   st.write(&quot;&quot;)
   image = Image.open(BytesIO(contenttent))
   st.image(image, caption='Classifying Dog/Cat Image', use_column_width=True)
  </code></pre>