ashnkumar / sketch-code

Keras model to generate HTML code from hand-drawn website mockups. Implements an image captioning architecture to drawn source images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No module named inference.Sampler

bibhas2 opened this issue · comments

This line in convert_single_image.py is causing problems.

from classes.inference.Sampler import *
Traceback (most recent call last):
  File "convert_single_image.py", line 7, in <module>
    from classes.inference.Sampler import *
ImportError: No module named inference.Sampler

Can you expound more on the issue? I've run through a bunch of examples and haven't had any errors.

Sorry, I should have added more details. Here are the steps to reproduce.

I have Python 2.7.13.

I cloned this repo.

Installed the required packages pip install -r requirements.txt.

Downloaded the data and pretrained weights.

Then from the src folder I ran the convert_single_image.py script

python convert_single_image.py ...

I got this error:

Traceback (most recent call last):
  File "convert_single_image.py", line 7, in <module>
    from classes.inference.Sampler import *
ImportError: No module named inference.Sampler

Ah, that's the problem. The program isn't compatible with Python 2.x only Python 3.x.

Prerequisites
Python 3 (not compatible with python 2)
pip

Ah, thank you. I missed the prerequisites.

I also getting that problem my version is above 3

I also getting that problem my version is above 3

this will work only with python 3.6.4 version
please do perform these task in order

  1. !pip install opencv-python
  2. !apt update && apt install -y libsm6 libxext6
  3. !apt-get install -y libxrender-dev
  4. sudo apt-get install libsm6 libxrender1 libfontconfig1
  5. sudo python3 -m pip install opencv-contrib-python
  6. pip uninstall numpy
  7. pip uninstall numpy
  8. this two times becoz there are two version got installed by this time so we need to remove all of them
  9. pip install numpy

after this it will run without any problem