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

Error while loading the pre-trained model #190

Closed
psjanani opened this issue Oct 1, 2017 · 4 comments
Closed

Error while loading the pre-trained model #190

psjanani opened this issue Oct 1, 2017 · 4 comments

Comments

@psjanani
Copy link
Collaborator

psjanani commented Oct 1, 2017

initialized BilingualTrainingCorpus({'dev_src': '/projects/tir2/users/sjpadman/temp_data/bilingual_dev_src.txt', 'dev_trg': '/projects/tir2/users/sjpadman/temp_data/bilingual_dev_tar.txt', 'train_src': '/projects/tir2/users/sjpadman/temp_data/bilingual_train_src.txt', 'train_trg': '/projects/tir2/users/sjpadman/temp_data/bilingual_train_tar.txt'})
   Traceback (most recent call last):
     File "xnmt/xnmt_run_experiments.py", line 166, in <module>
          sys.exit(main())
     File "xnmt/xnmt_run_experiments.py", line 120, in main
          xnmt_trainer = xnmt.xnmt_train.XnmtTrainer(train_args)
     File "/projects/tir1/users/sjpadman/xnmt/xnmt/xnmt_train.py", line 101, in __init__
          self.load_corpus_and_model()
     File "/projects/tir1/users/sjpadman/xnmt/xnmt/xnmt_train.py", line 162, in load_corpus_and_model
          self.corpus_parser = self.model_serializer.initialize_object(corpus_parser) if self.need_deserialization else self.args.corpus_parser
     File "/projects/tir1/users/sjpadman/xnmt/xnmt/serializer.py", line 54, in initialize_object
          return self.init_components_bottom_up(deserialized_yaml, deserialized_yaml.dependent_init_params(), context=context)
     File "/projects/tir1/users/sjpadman/xnmt/xnmt/serializer.py", line 139, in init_components_bottom_up
          init_params[init_arg] = self.init_components_bottom_up(val, sub_dependent_init_params, context)
     File "/projects/tir1/users/sjpadman/xnmt/xnmt/serializer.py", line 139, in init_components_bottom_up
          init_params[init_arg] = self.init_components_bottom_up(val, sub_dependent_init_params, context)
     File "/projects/tir1/users/sjpadman/xnmt/xnmt/serializer.py", line 158, in init_components_bottom_up
          print("initialized %s(%s)" % (obj.__class__.__name__, init_params))
     File "/projects/tir1/users/sjpadman/xnmt/xnmt/tee.py", line 40, in write
          self.stdstream.write(" " * self.indent + data)
   UnicodeEncodeError   :    'ascii' codec can't encode character '\xe1' in position 99: ordinal not in range(128)

The above error is thrown while trying to load a pre-trained model.

@neubig
Copy link
Contributor

neubig commented Oct 1, 2017

Is this on Python 2 or 3?

@psjanani
Copy link
Collaborator Author

psjanani commented Oct 1, 2017

This is Python 3.

@MattX
Copy link
Collaborator

MattX commented Oct 11, 2017

If by any chance you're using the PyCharm console, it does weird things and convinces Python to use ASCII instead of Unicode. You can fix it by adding LC_ALL=en_US.UTF-8 to the run configuration's environment variables.

@psjanani
Copy link
Collaborator Author

psjanani commented Oct 11, 2017

It was on the 'tir' cluster. I circumvented it by removing the print statements locally. The error was while printing the vocab.

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

3 participants