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

ImportError: No module named 'voc' #8

Closed
KhaledSharif opened this issue Mar 28, 2018 · 2 comments
Closed

ImportError: No module named 'voc' #8

KhaledSharif opened this issue Mar 28, 2018 · 2 comments

Comments

@KhaledSharif
Copy link

How to reproduce

import tensorflow as tf
import tensornets as nets

inputs = tf.placeholder(tf.float32, [None, 416, 416, 3])
model = nets.YOLOv2(inputs, nets.Darknet19)

img = nets.utils.load_img('cat.png')

with tf.Session() as sess:
    sess.run(model.pretrained())
    preds = sess.run(model, {inputs: model.preprocess(img)})
    boxes = model.get_boxes(preds, img.shape[1:3])

from tensornets.datasets import voc
print("%s: %s" % (voc.classnames[7], boxes[7][0]))  # 7 is cat

Error trace

Traceback (most recent call last):
  File "main.py", line 14, in <module>
    from tensornets.datasets import voc
  File "/usr/local/lib/python3.5/dist-packages/tensornets/datasets/__init__.py", line 1, in <module>
    import voc
ImportError: No module named 'voc'

Possible fix

Commenting out the first (and only) line in /usr/local/lib/python3.5/dist-packages/tensornets/datasets/__init__.py fixes the issue. A real fix would probably deal with absolute and relative imports though.

Environment details

python3.5
tensorflow (1.6.0)
tensorflow-gpu (1.6.0)
tensorflow-tensorboard (0.4.0rc3)
tensornets (0.3.1)
darkflow (1.0.0)
@alain2208
Copy link

your fix worked for me

@taehoonlee
Copy link
Owner

The issue has been resolved by this patch. If you want to use the latest version, you can try pip install -U --no-deps git+https://github.com/taehoonlee/tensornets. Thank you for the comments, @KhaledSharif!

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