photomosaic icon indicating copy to clipboard operation
photomosaic copied to clipboard

Error indexing

Open leifdalan opened this issue 7 years ago • 1 comments

I'm getting an error trying trying to run the following:

    --target "media/example/photo.jpg" \
    --savepath "media/output/%s-mosaic-scale-%d.jpg" \
    --codebook-dir "media/pics" \
    --scale 5 \
    --height-aspect 1 \
    --width-aspect 1 \
    --vectorization-factor 1

After I changed the mount in the launch.sh:

docker run \
	--rm \
	--name $CONTAINER_NAME \
	--mount type=bind,source="$(pwd)",target=/project \
	--mount type=bind,source="/Users/leif/Desktop/pics/",target=/project/media/pics \
	-p "$PORT:$PORT/tcp" \
	-e "DISPLAY=$IP:0" \
	mosaic-conda:latest \
	jupyter notebook \
		--allow-root \
		--ip 0.0.0.0 \
		--no-browser \
		--NotebookApp.token='' \
		--notebook-dir=/project

I get the following when running from both inside the container and from inside the GUI with a "new notebook (replacing python with run)

Caching is ON, checking for previously cached index...
No cached index found, creating from scratch...
Indexing: 3 images, 0.3186 seconds (0.1062 per image)
Traceback (most recent call last):
  File "/project/emosaic/utils/indexing.py", line 158, in index_images
    index.add(matrix)
  File "/opt/conda/lib/python2.7/site-packages/faiss/__init__.py", line 100, in replacement_add
    self.add_c(n, swig_ptr(x))
  File "/opt/conda/lib/python2.7/site-packages/faiss/swigfaiss.py", line 1941, in add
    return _swigfaiss.IndexFlat_add(self, n, x)
TypeError: in method 'IndexFlat_add', argument 3 of type 'float const *'

In both inside the container and inside the gui, the result is being kicked into a ipdb prompt.

Any ideas? I got a successful build, obviously. Don't really have working knowledge of faiss.

Thanks in advance!

leifdalan avatar Dec 15 '18 23:12 leifdalan

what shape is the matrix? what's the dtype? usually those types of faiss errors are related to this.

worldveil avatar May 20 '19 06:05 worldveil