Open KalaiKumarR opened 2 years ago
Hi @KalaiKumarR Kindly help me reproduce the issue you are facing with some more details. Please make sure you have:
I have also done the same
Downloaded the anaconda -> Downloaded the repo and extracted -> opened the anaconda prompt -> nevigated to the repo
-> conda env create -f environment.yml
-> conda activate virtualFit
-> streamlit run app.py
-> Getting the below mentioned error. I am not sure why? May be it asking for the streamlit argument. My python version 3.9.7
Error: (base) C:\Users\kalaikumar.rajan\Downloads\fitness_trainer-main\fitness_trainer-main\app>python --version Python 3.9.7
(base) C:\Users\kalaikumar.rajan\Downloads\fitness_trainer-main\fitness_trainer-main\app>conda activate virtualFit
(virtualFit) C:\Users\kalaikumar.rajan\Downloads\fitness_trainer-main\fitness_trainer-main\app>streamlit run app.py
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501 Network URL: http://10.93.46.61:8501
2022-04-11 09:35:57.113 Traceback (most recent call last):
File "c:\users\kalaikumar.rajan\anaconda3\envs\virtualfit\lib\site-packages\streamlit\script_runner.py", line 354, in _run_script
exec(code, module.dict)
File "C:\Users\kalaikumar.rajan\Downloads\fitness_trainer-main\fitness_trainer-main\app\app.py", line 95, in
Traceback (most recent call last):
File "
_streamlit run [FILE_NAME] [ARGUMENTS]_
2022-04-11 09:35:59.787 WARNING streamlit.state.session_state: Session state does not function when running a script without streamlit run
hi @kr-prince can you help me out? to resolve this issue
Hi, @KalaiKumarR I have a Ubuntu 20.04.4 LTS system. I re-did all the steps from scratch. It works fine. I am trying to recreate this on a windows system. Will get back to you.
Hi, @KalaiKumarR I was able to recreate this issue on a windows system. The problem is, multiprocessing
uses different approaches while starting a new process in Windows(spawn) and Unix(fork).
The error we are getting is because the required objects have to be serialized and shared, which is okay if the process is simple and requires basic functions and inbuilt data structures, but becomes a huge problem if the run method is handling more complex requirements and sharing complex objects(our case). fork is not available in Windows. I tried to find a solution for this, or a workaround for Windows but haven't been successful so far. Please refer the below links: multiprocessing-fork-vs-spawn Python official docs - multiprocessing
I kind of knew multi-processing was not the best system design for this application, but was focused more on the data science aspect. Now will have to re-think on the system design aspect. Feel free to share/contribute if you find out something.
Getting error when I try to run 'streamlit run app.py'
TypeError: cannot pickle 'module' object
Traceback: File "c:\users\kalaikumar\anaconda3\envs\virtualfit\lib\site-packages\streamlit\script_runner.py", line 354, in _run_script exec(code, module.__dict__) File "C:\Users\kalaikumar\Downloads\fitness_trainer-main\fitness_trainer-main\app\app.py", line 95, in <module> main() File "C:\Users\kalaikumar\Downloads\fitness_trainer-main\fitness_trainer-main\app\app.py", line 43, in main me = MainEngine() File "C:\Users\kalaikumar\Downloads\fitness_trainer-main\fitness_trainer-main\app\main_engine.py", line 21, in __init__ self.run() File "C:\Users\kalaikumar\Downloads\fitness_trainer-main\fitness_trainer-main\app\utils\worker.py", line 30, in run self.proc.start() File "c:\users\kalaikumar\anaconda3\envs\virtualfit\lib\multiprocessing\process.py", line 121, in start self._popen = self._Popen(self) File "c:\users\kalaikumar\anaconda3\envs\virtualfit\lib\multiprocessing\context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "c:\users\kalaikumar\anaconda3\envs\virtualfit\lib\multiprocessing\context.py", line 327, in _Popen return Popen(process_obj) File "c:\users\kalaikumar\anaconda3\envs\virtualfit\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__ reduction.dump(process_obj, to_child) File "c:\users\kalaikumar\anaconda3\envs\virtualfit\lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj)