Good evening
I receive the following error in the cloud console, trying to reboot the app. ( Error installing requirements.)I tried adding lxml to the requirements before anything else - > same error. Alas, this venerable forum was not much of a help. Any assistance will be VERY appreciated!
Collecting lxml
Downloading lxml-5.0.0.tar.gz (3.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 67.4 MB/s eta 0:00:00[2023-12-29 23:12:16.140463]
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
/tmp/pip-install-u6ri47x_/lxml_ef913bea948448b6941de9b549d33c7f/setup.py:67: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
Building lxml version 5.0.0.
Building without Cython.
Error: Please make sure the libxml2 and libxslt development packages are installed.
[end of output]
Thank u Tony! Specifying the lxml version really helped with prerequisite installation, however now there is an issu with keras module:
2023-12-30 10:41:45.375 503 GET /script-health-check (10.12.194.147) 976.90ms
2023-12-30 10:41:49.941 Uncaught app exception
Traceback (most recent call last):
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
exec(code, module.__dict__)
File "/mount/src/stock_prediction/stock_prediction.py", line 9, in <module>
model = load_model('Stock_Predictions_Model.keras')
File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/saving_api.py", line 254, in load_model
return saving_lib.load_model(
File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/saving_lib.py", line 281, in load_model
raise e
File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/saving_lib.py", line 269, in load_model
_load_state(
File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/saving_lib.py", line 466, in _load_state
_load_container_state(
File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/saving_lib.py", line 534, in _load_container_state
_load_state(
File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/saving_lib.py", line 457, in _load_state
_load_state(
File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/saving/saving_lib.py", line 435, in _load_state
trackable.load_own_variables(weights_store.get(inner_path))
File "/home/adminuser/venv/lib/python3.9/site-packages/keras/src/engine/base_layer.py", line 3531, in load_own_variables
raise ValueError(
ValueError: Layer 'lstm_cell' expected 3 variables, but received 0 variables during loading. Expected: ['lstm_8/lstm_cell/kernel:0', 'lstm_8/lstm_cell/recurrent_kernel:0', 'lstm_8/lstm_cell/bias:0']
2023-12-30 10:41:50.473 503 GET /script-health-check (10.12.194.147) 1046.16ms
Were you able to solve your problem? From the example given, it seems you are loading weights into the LSTM layer but the saved model does not have the same number of weights. Can you check your saved model to be sure?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.