Output not loading while running after deploying

/home/adminuser/venv/lib/python3.10/site-packages/streamlit/runtime/scriptru  
  nner/script_runner.py:565 in _run_script                                      
                                                                                
  /mount/src/optimization-of-npk-anlaysis-using-deep-learning/app.py:267 in     
  <module>                                                                      
                                                                                
    264 if a == "Home":                                                         
    265 │   display_Home()                                                      
    266 elif a == "Analysis":                                                   
  ❱ 267 │   display_Analysis()                                                  
    268 elif a == "Contact Us":                                                 
    269 │   display_Contact_us()                                                
    270                                                                         
                                                                                
  /mount/src/optimization-of-npk-anlaysis-using-deep-learning/app.py:160 in     
  display_Analysis                                                              
                                                                                
    157 │   if st.button("Submit"):                                             
    158 │   │   tabs = st.tabs(['Result', 'Visual Representation'])             
    159 │   │   with tabs[0]:                                                   
  ❱ 160 │   │   │   process_analysis(nitrogen, phosphorus, potassium, Temperat  
    161 │   │   with tabs[1]:                                                   
    162 │   │   │   st.subheader('Visual Representation')                       
    163 │   │   │   if tabs[1].is_active:                                       
                                                                                
  /mount/src/optimization-of-npk-anlaysis-using-deep-learning/app.py:194 in     
  process_analysis                                                              
                                                                                
    191 │   │   None                                                            
    192 │   """                                                                 
    193 │   l = [n, p, k, T, H, aph]                                            
  ❱ 194 │   crop = solve(l)                                                     
    195 │   crop = ''.join(crop)                                                
    196 │   display_result(crop, l)                                             
    197                                                                         
                                                                                
  /mount/src/optimization-of-npk-anlaysis-using-deep-learning/app.py:237 in     
  solve                                                                         
                                                                                
    234 │   label_encoder = LabelEncoder()                                      
    235 │   y_encoded = label_encoder.fit_transform(y)                          
    236 │   rf_classifier = joblib.load(rf_model_path)                          
  ❱ 237 │   model = tf.keras.models.load_model(rnn_model_path)                  
    238 │   rf_prediction = rf_classifier.predict(testing_data)                 
    239 │   rnn_prediction = np.argmax(model.predict(np.expand_dims(testing_da  
    240 │   cmb_predc = (rf_prediction + rnn_prediction) / 2                    
                                                                                
  /home/adminuser/venv/lib/python3.10/site-packages/keras/utils/traceback_util  
  s.py:70 in error_handler                                                      
                                                                                
     67 │   │   │   filtered_tb = _process_traceback_frames(e.__traceback__)    
     68 │   │   │   # To get the full stack trace, call:                        
     69 │   │   │   # `tf.debugging.disable_traceback_filtering()`              
  ❱  70 │   │   │   raise e.with_traceback(filtered_tb) from None               
     71 │   │   finally:                                                        
     72 │   │   │   del filtered_tb                                             
     73                                                                         
                                                                                
  /home/adminuser/venv/lib/python3.10/site-packages/keras/engine/input_layer.p  
  y:152 in __init__                                                             
                                                                                
    149 │   │   │   │   batch_size = batch_input_shape[0]                       
    150 │   │   │   │   input_shape = batch_input_shape[1:]                     
    151 │   │   if kwargs:                                                      
  ❱ 152 │   │   │   raise ValueError(                                           
    153 │   │   │   │   f"Unrecognized keyword arguments: {list(kwargs.keys())  
    154 │   │   │   )                                                           
    155                                                                         
────────────────────────────────────────────────────────────────────────────────
ValueError: Unrecognized keyword arguments: ['batch_shape']

I’m not able to find any errors while running it in my local machine but I’m getting this errors after deploying it into the streamlit cloud. app is deployed but to get the output we have to click the submit button after clicking it got the above error.
Can anyone able to look into this once.
Here is my Repo Link - Github Repo

Below error is the onscreen output

Traceback:

File "/home/adminuser/venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)File "/mount/src/optimization-of-npk-anlaysis-using-deep-learning/app.py", line 267, in <module>
    display_Analysis()File "/mount/src/optimization-of-npk-anlaysis-using-deep-learning/app.py", line 160, in display_Analysis
    process_analysis(nitrogen, phosphorus, potassium, Temperature, Humidity, PH_Value)File "/mount/src/optimization-of-npk-anlaysis-using-deep-learning/app.py", line 194, in process_analysis
    crop = solve(l)File "/mount/src/optimization-of-npk-anlaysis-using-deep-learning/app.py", line 237, in solve
    model = tf.keras.models.load_model(rnn_model_path)File "/home/adminuser/venv/lib/python3.10/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from NoneFile "/home/adminuser/venv/lib/python3.10/site-packages/keras/engine/input_layer.py", line 152, in __init__
    raise ValueError(

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.