Giter Club home page Giter Club logo

Comments (6)

marshallcase avatar marshallcase commented on September 10, 2024 2

I'm still getting the same issue too - getting the modules as close to the version Wengong was using as in issue #20 as follows:

rdkit                     2019.03.4.0      py37hc20afe1_1
python                    3.7.6                h0371630_2
pytorch                   1.12.0          py3.7_cuda11.6_cudnn8.3.2_0
numpy                     1.21.5           py37h6c91a56_3

still gives me the following issue:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/home/marcase/.conda/envs/hgraph-rdkit/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/home/marcase/.conda/envs/hgraph-rdkit/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "preprocess.py", line 19, in tensorize
    x = MolGraph.tensorize(mol_batch, vocab, common_atom_vocab)
  File "/home/marcase/hgraph2graph/hgraph/mol_graph.py", line 153, in tensorize
    tree_tensors, tree_batchG = MolGraph.tensorize_graph([x.mol_tree for x in mol_batch], vocab)
  File "/home/marcase/hgraph2graph/hgraph/mol_graph.py", line 194, in tensorize_graph
    fnode[v] = vocab[attr]
  File "/home/marcase/hgraph2graph/hgraph/vocab.py", line 43, in __getitem__
    return self.hmap[x[0]], self.vmap[x]
KeyError: 'C1=CNN=C1'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "preprocess.py", line 106, in <module>
    all_data = pool.map(func, batches)
  File "/home/marcase/.conda/envs/hgraph-rdkit/lib/python3.7/multiprocessing/pool.py", line 268, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/home/marcase/.conda/envs/hgraph-rdkit/lib/python3.7/multiprocessing/pool.py", line 657, in get
    raise self._value
KeyError: 'C1=CNN=C1'

from hgraph2graph.

byooooo avatar byooooo commented on September 10, 2024

I also had this issue (see #20). It might help to try rerunning with the vocab and preprocessing using rdkit=2019.03.4.0

from hgraph2graph.

orubaba avatar orubaba commented on September 10, 2024

Hey, where you able to solve the issue? I'm having similar issue now. kindly share your solution if any!
image

from hgraph2graph.

Bunnybeibei avatar Bunnybeibei commented on September 10, 2024

I solved this problem by regenerating the vocab.txt (use get_vocab.py), because this bug seems to occur when the drug can't tensorize by the vocab list.

from hgraph2graph.

abcdvzz avatar abcdvzz commented on September 10, 2024

I solved this problem by regenerating the vocab.txt (use get_vocab.py), because this bug seems to occur when the drug can't tensorize by the vocab list.

Can you elaborate more on how you solved it?

from hgraph2graph.

Bunnybeibei avatar Bunnybeibei commented on September 10, 2024

I solved this problem by regenerating the vocab.txt (use get_vocab.py), because this bug seems to occur when the drug can't tensorize by the vocab list.

Can you elaborate more on how you solved it?

I mean, if we want to preprocess a list of SMILES, it's necessary to first run the get_vocab.py file to create a customized vocab.txt. Then, we can replace the given vocab.txt in the preprocess.py file with the one we have created. The author might have included differences in his version of vocab.txt, so we could regenerate the vocab.txt file to solve the issue.

from hgraph2graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.