0

can anyone tell me the error here?

import pytorch_translator as pt
import pickle
import torch
# Set up the dictionary (vocab table)
pairs, src, tgt = pt.genLangs("de", "en", "train-short.txt", vocab_size=6000)
with open("langs.pkl", 'wb') as outfile:
     pickle.dump((src, tgt), outfile)

teacher_forcing_ratio = 0.5
hidden_size = 128

AttributeError Traceback (most recent call last) in () 1 # Set up the dictionary (vocab table) ----> 2 pairs, src, tgt = pt.genLangs("de", "en", "train-short.txt", vocab_size=6000) 3 with open("genLangs.pkl", 'wb') as outfile: 4 pickle.dump((src, tgt), outfile) 5

AttributeError: 'module' object has no attribute 'genLangs'

There is something wrong with the genLangs but i can't find anything about this in pytorch, which suggests that it is wrong, but i don't know what is right to go there. completely removing it gives a syntax error.

Helen
  • 3
  • 4
  • How you import pytorch_translator? Is this written by yourself? – sam Apr 01 '18 at 06:38
  • It's not written by me, but i'm meant to use it. The part with the imports shows no problems. – Helen Apr 01 '18 at 12:33
  • What is `pytorch_translator`. This is not an official package from `pytorch`. Maybe, you would like to post the source of `pytorch_translator` and explain what it is? – layog Apr 02 '18 at 16:24
  • Hi, thanks for your suggestions, this was a fault with another file, and has been solved. – Helen Apr 06 '18 at 22:33

0 Answers0