wengong-jin / hgraph2graph

Hierarchical Generation of Molecular Graphs using Structural Motifs
MIT License
379 stars 110 forks source link

Getting error during vocab generation for graph translation. #16

Closed SejeongPark8354 closed 4 years ago

SejeongPark8354 commented 4 years ago

First of all, thank you for your wonderful research for molecule generation. I wanted to make vacab for my dataset (from L1000 dataset). Before vocab generation, I converted my SMILES to canonical SMILES. However, I got this error continuously when I run vocab.py. I think there were some problems regarding tree decomposition. Is there any solution for this error? I will wait your comment. Thanks.

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/sejeong/anaconda3/envs/PSJ/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/home/sejeong/anaconda3/envs/PSJ/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "get_vocab.py", line 11, in process
    hmol = MolGraph(s)
  File "/home/sejeong/generative_model/codes/hgraph2graph/hgraph/mol_graph.py", line 22, in __init__
    self.mol_tree = self.tree_decomp()
  File "/home/sejeong/generative_model/codes/hgraph2graph/hgraph/mol_graph.py", line 83, in tree_decomp
    assert n - m <= 1  # must be connected
AssertionError
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "get_vocab.py", line 30, in <module>
    vocab_list = pool.map(process, batches)
  File "/home/sejeong/anaconda3/envs/PSJ/lib/python3.7/multiprocessing/pool.py", line 268, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/home/sejeong/anaconda3/envs/PSJ/lib/python3.7/multiprocessing/pool.py", line 657, in get
    raise self._value
AssertionError