DSPsleeporg/smiles-transformer

No module named 'pretrain_trfm'

Closed this issue · 2 comments

Thank you so much for your implementation.

When I ran your experiments/ablation1.jpynb, I got the following error message:

ModuleNotFoundError Traceback (most recent call last)
in
1 import torch
----> 2 from pretrain_trfm import TrfmSeq2seq
3 from pretrain_rnn import RNNSeq2Seq
4 from bert import BERT
5 from build_vocab import WordVocab

ModuleNotFoundError: No module named 'pretrain_trfm'

The error occurs because "pretrain_trfm" is not seen from .ipynb file.
Import by from ..smiles_transformer.pretrain_trfm import TrfmSeq2seq or set path by

import sys
sys.path.append("../smiles_transformer/")

c.f. https://stackoverflow.com/a/50011984

Thank you. The second option works.
I am not sure if you missed init.py file at the folder /smiles_transformer