Comments (7)
Thank you for trying TensorNets, @LynnHo. Can you share a TensorNets version and your snippets to reproduce the error? The different input shape is not related to the weight shape mismatching. Maybe, I guess that you use different classes
. And the lines 321-324 are to handle the different classes
as you expected.
from tensornets.
@taehoonlee I use a code like below,
import tensorflow as tf
import tensornets as nets
input_256 = tf.placeholder(dtype=tf.float32, shape=[None, 256, 256, 3])
network = nets.VGG16(input_256)
sess = tf.Session()
sess.run(network.pretrained())
and the error is,
ValueError: Dimension 0 in both shapes must be equal, but are 32768 and 25088. Shapes are [32768,4096] and [25088,4096]. for 'Assign_26' (op: 'Assign') with input shapes: [32768,4096], [25088,4096].
If the shape is [None, 224, 224, 3], the code works.
from tensornets.
@LynnHo, I see. I misunderstood the problem. The VGG16 and the VGG19 accept only a size of 224x224 because the fc6
layer produces a 4096-dimensional vector from a 25088(=77512)-dim vector. The error is from VGG's non-flexible architecture (accepting only fixed input sizes), not the line 320.
from tensornets.
@taehoonlee But if I just want to load the pretrained weights of Convs ignoring the FCs‘, line 320 is unsuitable. I modified the code at line 320-324 to blow, it works for me
ops = []
for w, v in zip(weights, values):
if w.shape != v.shape:
ops.append(w.initializer)
else:
ops.append(w.assign(v))
from tensornets.
@LynnHo, Thank you for the idea. But the proposed one will load all the weights except the middle layer fc6
. I think it is error-prone. For the users who want to exploit all the weights, I think it is better to show the mismatch error rather than a silent error due to the random middle layer fc6
.
from tensornets.
@taehoonlee You are right, the shape mismatch should be shown. Or an argument to control the ignoring of the shape mismatch would be better. Anyway, thanks a lot!
from tensornets.
@LynnHo, Yes I will considering the argument to control the shape mismatch. Thank you for the idea.
from tensornets.
Related Issues (20)
- Dropout HOT 1
- Notes for variable_scope, name_scope, and weight sharing
- tensornets on windows 10 HOT 5
- Notes for logits and softmax_cross_entropy
- Validation loss exploding, potentially due to setting is_training = False HOT 1
- Tensornets not working with threading.Threads
- Unable to pip install tensornets on production HOT 1
- For getting more accuracy in faster rcnn , which parameters i have to tune (tuning parameters)
- Notes for the updates of the performance table
- No module named 'tensorflow.contrib' HOT 5
- Error on loading pre-trained model HOT 1
- custom weights for tensornet model HOT 2
- input YOLOv3COCO Darknet 9000?
- Attribute Error logits HOT 1
- importing weights from darknet yolov3
- The drop rate of EfficientNet is fixed
- Confusing result when I load pretrained weight for mobilenetv3smallmini.
- I tried to install tensornet on my jenkins VM which uses ubuntu 20.04,python 3.6.10, pip 20.1.1
- Create a more robust pyproject.toml file
- Performance issue in /translations/tfslim.py (by P3) HOT 1
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 tensornets.