Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use ORGANIC #6

Open
xuzhang5788 opened this issue Jun 23, 2018 · 11 comments
Open

how to use ORGANIC #6

xuzhang5788 opened this issue Jun 23, 2018 · 11 comments

Comments

@xuzhang5788
Copy link

Although I read your tutorial, I still didn't know how to use it.

First of all, I run $ pip install -r requirement.txt

I don't know what GPmol is.

Secondly, When I run model = ORGANIC('tutorial1', params=params)

it was told that ORGANIC is not defined.

If I add
from organic import ORGANIC

it was told that organic is not a module.

I am so sorry that your tutorial is not very clear. If you would like to prepare a jupyter notebook to explain how to use it, it will be a great help.

Thank you very much for great work.

@prokia
Copy link

prokia commented Jun 24, 2018

I have the same problem and hope for a realizable solution.

@ianwesleyarmstrong
Copy link

@xuzhang5788 I have had more luck managing the environment with Anaconda rather thatn pip. The command used to create the environment with all dependencies is
conda env update -f=requirements.yml

@prokia
Copy link

prokia commented Jul 4, 2018

@RussianCircles I have successfully created the environment with requirements.yml. But when I run model = ORGANIC('tutorial1', params=params), it was told that ORGANIC is not defined as before. I wonder how can I run ORGANIC as shown in tutorial. Thank you for your kind suggestion.

@ianwesleyarmstrong
Copy link

ianwesleyarmstrong commented Jul 4, 2018

That's good to hear! This is the current script I am using to run ORGANIC. I hope you can take some cues from it. I would try running the import like I have below

from model.organic import ORGANIC

organ_params = {
    'PRETRAIN_GEN_EPOCHS': 250, 'PRETRAIN_DIS_EPOCHS': 20, 'MAX_LENGTH': 60, 'LAMBDA': 0.5, "DIS_EPOCHS": 2, 'SAMPLE_NUM': 6400, 'WGAN':True, 'TBOARD_LOG':True}

# hyper-optimized parameters
disc_params = {"DIS_L2REG": 0.2, "DIS_EMB_DIM": 32, "DIS_FILTER_SIZES": [
    1, 2, 3, 4, 5, 8, 10, 15], "DIS_NUM_FILTERS": [50, 50, 50, 50, 50, 50, 50, 75], "DIS_DROPOUT": 0.75}

organ_params.update(disc_params)

model = ORGANIC('test', params=organ_params)
model.load_training_set('data/smallmols_sub.smi')
# model.load_prev_pretraining('pretrain_ckpt/qm9-5k_pretrain_ckpt')
model.set_training_program(
    ['novelty'], [100])
model.load_metrics()
# model.load_prev_training(ckpt='qm9-5k_20.ckpt')
model.train()

@xuzhang5788
Copy link
Author

Thank you @RussianCircles
I run
from model.organic import ORGANIC, then I got:

ImportError Traceback (most recent call last)
in ()
----> 1 from model.organic import ORGANIC

/media/projects/ORGANIC/model/organic.py in ()
23 from future import absolute_import, division, print_function
24 import os
---> 25 from gpu_utils import pick_gpu_lowest_memory
26 try:
27 gpu_free_number = str(pick_gpu_lowest_memory())

ImportError: No module named 'gpu_utils'

When you run your script, which directory do you on? ORGANIC/ or ORGANIC/model?

@ianwesleyarmstrong
Copy link

I was running from the ORGANIC/ directory. I also had to play around with some of the imports in the organic.py file in ORGANIC/model to get it to work.

@xuzhang5788
Copy link
Author

@RussianCircles
I was also running from the ORGANIC directory. I used your conda method to create a virtual environment, but still got errors. What do you mean that play around with some of the imports?
gpu_utils.py is under model/ directory. Do I need to change
from gpu_utils import pick_gpu_lowest_memory
into
from model.gpu_utils import pick_gpu_lowest_memory?

@ianwesleyarmstrong
Copy link

Precisely. I had to go through and change all of the local function imports to reflect upon their hierarchy in the file system.

@xuzhang5788
Copy link
Author

@RussianCircles
Thank you so much.
I used your method to install ORGANIC, then go through several .py files to change imports (adding model.***), finally ORGANIC can run. However, it ran on CPU not GPU even through I installed tensorflow with " pip3 install --upgrade tensorflow-gpu==1.2.1". Any advice? Anyways, thank you so much for helping me a lot.

@ianwesleyarmstrong
Copy link

Ah. Do you have the CUDA toolkit/cuDNN installed? This is likely where your error lies. When you have that done, make sure to install the correct version of tensorflow for the CUDA version you are using. It should say in the documentation.

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html

@weiwen6
Copy link

weiwen6 commented Oct 5, 2019

I am getting a segfault 11 when I run it. What could be the likely error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants