Giter Club home page Giter Club logo

Comments (5)

miriambellver avatar miriambellver commented on June 13, 2024 1

Hi!
You have to download the model_image_zooms. Everything is explained in the README.
Míriam

from detection-2016-nipsws.

LiYingTW avatar LiYingTW commented on June 13, 2024

By the way, I've checked all package in "requirements.txt", all are the same except of these 8 packages, I have newer version:

  • package_name==my_version (your_version)

  • Cython==0.25.1 (0.24.1)

  • numpy==1.11.2 (1.11.1)

  • Pillow==3.4.2 (3.3.1)

  • prompt-toolkit==1.0.8 (1.0.7)

  • pyparsing==2.1.10 (2.1.3)

  • python-dateutil==2.6.0 (2.5.3)

  • pytz==2016.10 (2016.6.1)

  • scikit-learn==0.18.1 (0.17.1)

And, here is my folder path:
--font/
|----LiberationMono-Regular.ttf
--img/
--models_image_zooms/
|----model_image_zooms
--scripts/
--vgg16_weights.h5
--testing/

here, testing/ is empty
and the file "model_image_zooms" under the folder models_image_zooms/
was created by "touch models_image_zooms/model_image_zooms"
If not doing so (just have an empty folder models_image_zooms/)
I'll get this error message:

Using Theano backend.
Traceback (most recent call last):
File "image_zooms_testing.py", line 42, in
model = get_q_network(weights_path + model_name)
File "/auto/master05/liyi9487/project/detection-2016-nipsws/scripts/reinforcement.py", line 87, in get_q_network
model.load_weights(weights_path)
File "/home/master/05/liyi9487/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 2486, in load_weights
f = h5py.File(filepath, mode='r')
File "/home/master/05/liyi9487/.local/lib/python2.7/site-packages/h5py/_hl/files.py", line 272, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/home/master/05/liyi9487/.local/lib/python2.7/site-packages/h5py/_hl/files.py", line 92, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-build-v_zMzm/h5py/h5py/_objects.c:2847)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-build-v_zMzm/h5py/h5py/_objects.c:2805)
File "h5py/h5f.pyx", line 76, in h5py.h5f.open (/tmp/pip-build-v_zMzm/h5py/h5py/h5f.c:2093)
IOError: Unable to open file (Unable to open file: name = '../models_image_zooms/model_image_zooms', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)

from detection-2016-nipsws.

LiYingTW avatar LiYingTW commented on June 13, 2024

"You should also create two folders in the root of the project, called models_image_zooms and models_pool45_crops, and store inside them the corresponding weights."

So I should store vgg16_weights.h5 into models_image_zoom/ ?

Thank you for answering

from detection-2016-nipsws.

LiYingTW avatar LiYingTW commented on June 13, 2024

I got that!
"downloaded in the following links Image Zooms model and Pool45 Crops model"

yes, now I have these two weights under corresponding folders.
However, I still cannot run the code successfully:

python scripts/image_zooms_testing.py
Using Theano backend.
Traceback (most recent call last):
File "scripts/image_zooms_testing.py", line 41, in
model_vgg = obtain_compiled_vgg_16(path_vgg)
File "/auto/master05/liyi9487/project/detection-2016-nipsws/scripts/features.py", line 203, in obtain_compiled_vgg_16
model = vgg_16(vgg_weights_path)
File "/auto/master05/liyi9487/project/detection-2016-nipsws/scripts/features.py", line 255, in vgg_16
model.load_weights(weights_path)
File "/home/master/05/liyi9487/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 2486, in load_weights
f = h5py.File(filepath, mode='r')
File "/home/master/05/liyi9487/.local/lib/python2.7/site-packages/h5py/_hl/files.py", line 272, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/home/master/05/liyi9487/.local/lib/python2.7/site-packages/h5py/_hl/files.py", line 92, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-build-v_zMzm/h5py/h5py/_objects.c:2847)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-build-v_zMzm/h5py/h5py/_objects.c:2805)
File "h5py/h5f.pyx", line 76, in h5py.h5f.open (/tmp/pip-build-v_zMzm/h5py/h5py/h5f.c:2093)
IOError: Unable to open file (Unable to open file: name = '../vgg16_weights.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)

Here are my files under the root of the project:

ls -l
total 541448
-rw-r--r-- 1 liyi9487 cmlab 1101 Dec 20 09:46 LICENSE
-rw-r--r-- 1 liyi9487 cmlab 12657 Dec 20 09:46 README.md
drwxr-xr-x 2 liyi9487 cmlab 4096 Dec 20 09:46 authors
-rw-r--r-- 1 liyi9487 cmlab 898570 Dec 20 09:46 bellver-2016-nipsws.pdf
drwxr-xr-x 2 liyi9487 cmlab 4096 Dec 20 10:42 font
drwxr-xr-x 2 liyi9487 cmlab 4096 Dec 20 09:46 img
drwxr-xr-x 2 liyi9487 cmlab 4096 Dec 20 09:46 logos
drwxr-xr-x 2 liyi9487 cmlab 4096 Dec 23 13:48 models_image_zooms
drwxr-xr-x 2 liyi9487 cmlab 4096 Dec 23 13:50 models_pool45_crops
-rw-r--r-- 1 liyi9487 cmlab 547 Dec 20 09:46 requirements.txt
drwxr-xr-x 4 liyi9487 cmlab 4096 Dec 21 14:18 scripts
drwxr-xr-x 2 liyi9487 cmlab 4096 Dec 20 10:24 testing
-rwxrwxrwx 1 liyi9487 cmlab 553479920 Dec 20 14:56 vgg16_weights.h5

I do have the file " vgg16_weights.h5" and I even chmod to 0777.

Thank you for helping.

from detection-2016-nipsws.

LiYingTW avatar LiYingTW commented on June 13, 2024

I knew why!!

my classmate told me why, since I execute the file "image_zoom_testing.py" under the root of the project, but I need to execute that file under script/

thank u very much

from detection-2016-nipsws.

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.