chekoduadarsh / BlocklyML

BlocklyML is a simple visual programming Tool for python and ML. 🧩 🖥️
https://blocklyml.onrender.com/
Apache License 2.0
445 stars 44 forks source link

Is it possible to import deep learning packages and run it locally? #98

Closed maihao14 closed 2 years ago

maihao14 commented 2 years ago

Thanks for the fantastic project. I've developed a deep learning python package for earthquake detection. And just wondering if I could deploy (import) it on the BlocklyML; it will be easy for students/researchers to use for those who don't have much experience in deep learning. My questions are (sorry, I don't have much experience in JavaScript):

How can I run BlocklyML in the local end? (I tried to git clone this repo followed the instructions, but it doesn't work, it always shows Could not find a version that satisfies the requirement) Could I import my local python package (e.g., TensorFlow, Keras, homemade models/packages, etc.) into it and run it successfully? Any suggestions are welcome!

github-actions[bot] commented 2 years ago

Thank you for contributing to BLocklyML

chekoduadarsh commented 2 years ago

@maihao14

Thank you for trying out BlocklyML.

Can you please provide more detail on the error you were facing!!

you can copy paste the entire log here and which step you got the error

maihao14 commented 2 years ago

Thanks for your quick reply. Here's the details when I met the error, the scripts I used to install blockML in MAC OS terminal:

conda create -n blocklyml python=3
conda activate blocklyml
git clone https://github.com/chekoduadarsh/BlocklyML
cd BlocklyML
pip install -r requirements.txt 
python app.py

Then it will raise error information:

/Users/hao/Documents/Python/dev/BlocklyML/libs/dataframe_visualizer.py:9: FutureWarning: Passing a negative integer is deprecated in version 1.0 and will not be supported in future version. Instead, use None to not limit the column width.
  pd.set_option("display.max_colwidth", -1)
 * Serving Flask app 'app' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
Traceback (most recent call last):
  File "/Users/hao/Documents/Python/dev/BlocklyML/app.py", line 78, in <module>
    app.run(host='0.0.0.0')
  File "/Users/hao/opt/anaconda3/envs/blocklyml/lib/python3.10/site-packages/flask/app.py", line 920, in run
    run_simple(t.cast(str, host), port, self, **options)
  File "/Users/hao/opt/anaconda3/envs/blocklyml/lib/python3.10/site-packages/werkzeug/serving.py", line 991, in run_simple
    s.bind(server_address)
OSError: [Errno 48] Address already in use
chekoduadarsh commented 2 years ago

It looks like the error says the 0.0.0.0, and the port is in use,

can u change the code in app.py

from,

    app.run(host='0.0.0.0')

to,

    app.run(host='0.0.0.0', port=101)

To some random port number

chekoduadarsh commented 2 years ago

Or you can kill the processing running on that default port by following like this,

https://stackoverflow.com/questions/19071512/socket-error-errno-48-address-already-in-use

maihao14 commented 2 years ago

It looks like the error says the 0.0.0.0, and the port is in use,

can u change the code in app.py

from,

    app.run(host='0.0.0.0')

to,

    app.run(host='0.0.0.0', port=101)

To some random port number

I did a quick test of this. It can open the server http://192.168.0.15:101/ However, when I opened it on my browser, it is empty and show an error: ERR_UNSAFE_PORT Do you have any idea fix this? Many thanks.

chekoduadarsh commented 2 years ago

Hey sorry 101 was a restricted port!!

List of other unsafe port : https://dheeruthedeployer.medium.com/unsafe-ports-considered-by-chrome-6f447b7e4714

try with some other random number like 8008 or 8080 etc

maihao14 commented 2 years ago

My second question might be tricky. I am interested in reproducing a deep learning workflow as you did of the machine learning pipeline in the figure. image

Could you offer some instructions to create new blocks for those imported functions (and is it possible to import some functions? ), such as trainer, tester , 'load data' which I has written in another package? My goal is to using BlocklyML to let users create their own deep learning workflows for earthquake detection. Any suggestions are appreciated.

maihao14 commented 2 years ago

Hey sorry 101 was a restricted port!!

List of other unsafe port : https://dheeruthedeployer.medium.com/unsafe-ports-considered-by-chrome-6f447b7e4714

try with some other random number like 8008 or 8080 etc

Yes, this worked! Now it can successfully run! Thanks for the help!

chekoduadarsh commented 2 years ago

I will soon make a short WIKI on how to make custom blocks and other features. It might take me few days!!, Just to give u a head-start look into,

  1. blocks_ML.js
  2. python_ML.js

blockMLlyFS

chekoduadarsh commented 2 years ago

Yes, this worked! Now it can successfully run! Thanks for the help!

Happy to help 👍🏻

maihao14 commented 2 years ago

I am looking forward to the tutorial! It's an amazing repo and will help machine learning learners. I am looking forward to the WIKI coming.

chekoduadarsh commented 2 years ago

I will update the WIKI link here. Thanks alot of trying BlocklyML