Skip to content

Commit

Permalink
Use relative import so that models.py can be imported from a relative…
Browse files Browse the repository at this point in the history
… path
mkhon committed Jun 8, 2018
1 parent 552adb8 commit dccca75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models.py
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ def weights_Glorot(i, o, name, rng, is_logistic_sigmoid=False, keepdims=False):
return theano.shared(value=W_values, name=name, borrow=True)

def load(file_path, minibatch_size, x, p=None):
import models
from . import models
try:
import cPickle
except ImportError:

2 comments on commit dccca75

@rhamnett
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traceback (most recent call last):
File "/Users/rick/PycharmProjects/punctuator2/punctuator.py", line 149, in
net, _ = models.load(model_file, 1, x)
File "/Users/rick/PycharmProjects/punctuator2/models.py", line 54, in load
from . import models
ImportError: attempted relative import with no known parent package

@Davidobot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to revert this change to make it compatible with Python 3.6.8

Please sign in to comment.