spro / practical-pytorch

Go to https://github.com/pytorch/tutorials - this repo is deprecated and no longer maintained
MIT License
4.52k stars 1.11k forks source link

Issues w/ sconce, e.g. module 'sconce' has no attribute 'Job' #98

Open drscotthawley opened 6 years ago

drscotthawley commented 6 years ago

Hi, thanks for this example. I'm fairly new to this, and thought I'd try out the seq2seq-translation-batched example. It includes the statements...

Requirements

You will need PyTorch to build and train the models, and matplotlib for plotting training and visualizing attention outputs later. The rest are builtin Python libraries.

This is incorrect; something called 'sconce' is required as well, but doesn't get imported until farther down in the notebook. (NOTE: 'visdom' is also required, even further down.)

After locating and installing sconce (https://github.com/davidlmorton/pytorch-sconce, pip install pytorch-sconce), we find that it's loaded with f-strings, and thus will only run in Python 3.6, (EDIT: there's also https://github.com/asottile/future-fstrings).

So, upgrading everything to Python 3.6, we now get the message...


AttributeError Traceback (most recent call last)

in () 33 34 import sconce ---> 35 job = sconce.Job('seq2seq-translate', { 36 'attn_model': attn_model, 37 'n_layers': n_layers, AttributeError: module 'sconce' has no attribute 'Job'

Not sure where to go from here. How do you get this to work? Thanks.

spro commented 6 years ago

You can remove references to sconce and job, it's a plotting library (not davidlmorton/pytorch-sconce) that is not production ready.