Skip to content

Removed unused imports that were causing errors.#7

Open
ndahlquist wants to merge 1 commit intojph00:masterfrom
ndahlquist:utils_fixes
Open

Removed unused imports that were causing errors.#7
ndahlquist wants to merge 1 commit intojph00:masterfrom
ndahlquist:utils_fixes

Conversation

@ndahlquist
Copy link
Copy Markdown

I ran into these errors while trying to run DCGAN.ipynb (almost certainly due to different versions of Keras and nltk). Since these particular imports are unused, there is no reason to keep them.

~/workspace/part2/utils2.py in <module>()
     12 from gensim.models import word2vec
     13 from keras.preprocessing.text import Tokenizer
---> 14 from nltk.tokenize import ToktokTokenizer, StanfordTokenizer
     15 from functools import reduce
     16 from itertools import chain

ImportError: cannot import name 'StanfordTokenizer'
~/workspace/part2/utils2.py in <module>()
     20 
     21 from keras_tqdm import TQDMNotebookCallback
---> 22 from keras import initializations
     23 from keras.applications.resnet50 import ResNet50, decode_predictions, conv_block, identity_block
     24 from keras.applications.vgg16 import VGG16

ImportError: cannot import name 'initializations'

Note that many other imports in utils appear unused, but I've left them untouched (wanted to keep changes to a minimum).

Test Plan

  • Verify using PyCharm and grep that the imports are unused.
  • After other fixes, successfully run DCGAN.ipynb.

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

Successfully merging this pull request may close these issues.

1 participant