MrNothing / AI-Blocks

A powerful and intuitive WYSIWYG interface that allows anyone to create Machine Learning models!
https://mrnothing.github.io/AI-Blocks/index.html
Other
1.86k stars 224 forks source link

I encountered a error: #12

Closed lk1983823 closed 6 years ago

lk1983823 commented 6 years ago

When I clone a MNIST Classifier project and run it, I have an error like below:

Traceback (most recent call last): File "/tmp/main.py", line 1524, in instance_0.Run() File "/tmp/main.py", line 869, in Run instance = AIBlocks.InitModel(load_path=self.save_path) TypeError: unbound method InitModel() must be called with AIBlocks instance as first argument (got nothing instead)

I am using python 2.7.6 and tensorflow 1.3.0.

Thank you!

MrNothing commented 6 years ago

Hi, Thank you for using AI-Blocks, you need to install python 3.0+ for the program to work. Make sure there is a reference to python.exe in the path as well. I also suggest updating Tensorflow (not mandatory).

lk1983823 commented 6 years ago

@MrNothing thank you for your reply. Btw, can it run in a anaconda environment and how?

MrNothing commented 6 years ago

Conda environments are not supported for the moment, I am planning on adding the option since it would not be very hard to do on my side. I will let you know when this is implemented.

lk1983823 commented 6 years ago

My default python interpreter in Ubuntu14.04 is 2.7 and I often use anaconda3 evironment to run python files. So, how to let AI-blocks run under python3?

MrNothing commented 6 years ago

you would need to update python from 2.7 to 3.5. You can follow these instructions: https://superuser.com/questions/241865/updating-python-on-ubuntu-system

lk1983823 commented 6 years ago

I already have python3 in my ubuntu. Just run the command python3 instead of python. But by default, i think the system choose python2.7 to run. I just find a solution here, https://askubuntu.com/questions/590027/how-to-set-python-3-as-default-interpreter-in-ubuntu-14-04/590030. Can this make available by adding an alias for python to run python3?

MrNothing commented 6 years ago

The issue is that python is executed from my command prompt (more specifically, i spawn a default console process) on AI-Blocks' side. I would need to add the alias on this subprocess, unless the alias command could be made global which i doubt.

MrNothing commented 6 years ago

One quick fix if you run the project from the sources is to modify the file ProjectRunner.js and replace const exec = spawn('python', [folder+'/main.py']); with const exec = spawn('python3', [folder+'/main.py']); until i implement custom commands. I'm sorry for the inconvenience.

lk1983823 commented 6 years ago

thank you very much, I will try it when I am back home. :) +1:

lk1983823 commented 6 years ago

@MrNothing  I can't find the file ProjectRunner.js in your file AI-blocks.I download the file linux-x64.7z (v1.6.15) and unziped it directly in my ubuntu.

MrNothing commented 6 years ago

It only works if you run the project from the sources, if you take the prebuilt Linux version, the sources are not avaliable. Running the project from the sources is a tedious task as it requires to have other dependencies installed such as npm and electron.

lk1983823 commented 6 years ago

okay thx. And using the prebuilt Linux version, when I want to add script, it shows dark background and nothing else.