Comments (10)
Hi
The hard-coded "if False" in the notebook has to be set to True or False depending in the .mat file you downloaded from the previous text cell in the notebook:
Download from console with :
wget http://www.vlfeat.org/matconvnet/models/vgg-face.mat
Alternatively :
wget http://www.robots.ox.ac.uk/~vgg/software/vgg_face/src/vgg_face_matconvnet.tar.gz
I believe as it is (if False) it assumes you downloaded the second link: depending on the link the file is not structured the same way
If this comment does not help (let me know) I will download again the .mat file to clarify this point further
from neuralnets.
from neuralnets.
Hi,
The new bug you have is probably related to the settings in the keras.json file that is documented here;
https://keras.io/backend/
One variable that impacts the convolution tensor shapes is: "image_data_format"
What value does it have in your configuration ?
When I wrote this notebook I think I used "th" (legacy values) for it as I also used Theano. Anyway it is easy to translate from one value to another one as this is just about permuting the dimension orders.
This is a point I needs to clarify in the documentation cells of the notebook to facilitates replication !
In the Keras help link above you will find function "set_image_dim_ordering" that should tweak it without changing the Json file.
If you dont manage to fix it with this function I will run it with your settings to see.
from neuralnets.
from neuralnets.
from neuralnets.
Ok, great, we are on the right track!
It needs something like the following (A) or (B) at the beginning of the notebook:
A)
from keras import backend as K
K.set_image_data_format( 'channels_first' )
B)
from keras import backend as K
K.set_image_dim_ordering( 'th' )
Reading the doc I think the 2 things are equivalent but that (A) is the most recent version
from neuralnets.
from neuralnets.
I just debugged it running Keras 2, TensorFlow and "image_data_format":"channels_last"
Code has been pushed on Git repo.
The last bug you had came from the fact the Input tensor was potentially not ordered the right way depending on the "image_data_format" value at this line:
mdl.add( Permute((1,2,3), input_shape=(224,224,3)) ) # WARNING : 0 is the sample dim
Similarly in "copy_mat_to_keras" function there was a potential axis ordering issue.
As well as in "pred" function.
So I added the necessary information and code changes.
I used your default value for "image_data_format":"channels_last" as it seems to be more common.
Also if you use Keras 1 in "convblock" and "vgg_face_blank" functions I left as comments the Conv2D syntax.
from neuralnets.
from neuralnets.
from neuralnets.
Related Issues (11)
- fcn32model = fcn32_blank(image_size) generates the "TypeError: index must be integers" HOT 10
- Non squared images
- KeyError
- kernel_size for fc6
- Invalid links for pre-trained models in the ipynb files
- Some questions about the FCN code HOT 3
- TypeError: index must be integers for fcn32model = fcn32_blank(image_size) HOT 1
- the reason of using pascal-fcn16s-dag.mat instead of weight provided by Keras pretrained model HOT 1
- TypeError: index must be integers fcn8model1 = fcn_32s_to_8s(fcn32model)
- Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_10/MaxPool'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neuralnets.