Coder Social home page Coder Social logo

Comments (6)

kitstar avatar kitstar commented on April 28, 2024

Hi,

It is a absolute importing problem in Python2.7. Please update the pip package (name no changed) with:

pip install -U https://github.com/Microsoft/MMdnn/releases/download/0.1.0/mmdnn-0.1.0-py2.py3-none-any.whl

and try again. Thanks.

from mmdnn.

seanchung2 avatar seanchung2 commented on April 28, 2024

Thanks for prompt reply.

I tried to upgrade the package and the new error is:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/examples/tensorflow/extract_model.py", line 12, in <module>
    from mmdnn.conversion.examples.imagenet_test import TestKit
  File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/examples/imagenet_test.py", line 13, in <module>
    from tensorflow.contrib.keras.python.keras.preprocessing import image
ImportError: No module named python.keras.preprocessing

from mmdnn.

kitstar avatar kitstar commented on April 28, 2024

What is your tensorflow version? 1.4? Checked the package of tensorflow in windows is different from in linux. Please update the pip package and try again. Thanks.

from mmdnn.

seanchung2 avatar seanchung2 commented on April 28, 2024

I used Linux so I'm pretty sure it is 1.4.0. I updated again and it remains...

from mmdnn.

kitstar avatar kitstar commented on April 28, 2024

Fixed problem

Hi, I fixed a api changed [tensorflow.contrib.keras.python.keras.preprocessing] --> tensorflow.contrib.keras.api.keras.preprocessing

And reinstalled tensorflow 1.4 and mmdnn (both with pip) but can't reproduce this problem.

Question

If you pip package updated successfully, the error should become
[ImportError: No module named api.keras.preprocessing].

  1. If error is is still [tensorflow.contrib.keras.python.keras.preprocessing]

Please check the file [~/.local/lib/python3.5/site-packages/mmdnn/conversion/examples/imagenet_test.py](my python library path, please change to your path) and see if there are lines like

# work for tf 1.4 in windows & linux
from tensorflow.contrib.keras.api.keras.preprocessing import image

if it is just

from tensorflow.contrib.keras.python.keras.preprocessing import image

which means the pip package is not updated. Please try this before re-install

pip uninstall mmdnn 
  1. If the error is [No module named api.keras.preprocessing]

Please check if you can call

python -c "from tensorflow.contrib.keras.api.keras.preprocessing import image"

Thanks for diagnosing the problem.

from mmdnn.

seanchung2 avatar seanchung2 commented on April 28, 2024

The problem has been resolved. Thank you!

from mmdnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.