Comments (5)
In fact, the files correspond to :
VGGnet_fast_rcnn_iter_70000.ckpt.data-00000-of-00001
: data itself (weigths and all)VGGnet_fast_rcnn_iter_70000.ckpt.index
: (I actually have no idea haha)VGGnet_fast_rcnn_iter_70000.ckpt.meta
: the graph definition and all metadata associated
Tensorflow can restore the model from a trio of model.ckpt.index
, model.ckpt.meta,
model.ckpt.data
with for example here args.model = model.ckpt
:
saver = tf.train.Saver()
saver.restore(sess, args.model)
But to run the demo from this training, you have to change the condition on the existence of the model which is either on the model.ckpt
file (that may not exist), either on the model.ckpt.xxxx
file(s) (where you can't restore the session). Theses lines test if the user gave a model.ckpt.xxxx
file and then give to the saver
the right model.ckpt
.
if not os.path.splitext(args.model)[1] == 'ckpt':
model_path = args.model
args.model = os.path.splitext(args.model)[0]
if args.model == ' ' or not os.path.exists(model_path):
print ('current path is ' + os.path.abspath(__file__))
raise IOError(('Error: Model not found.\n'))
You can add it/replace in the demo.py , just after the parsing of the args. Then give the path to an existing model file e.g :
python ./faster_rcnn/demo.py --model dir_model_path/model.ckpt.meta
A link to an article which explain how the data that is saved [1] . That's just a little solution, I am not a python expert neither a tensorflow expert.
from tffrcnn.
Thanks @ChrisDal , I believe the trio files format introduced as part of the new saver of Tensorflow - tf.train.SaverDef.V2 which is defaulted now.
Ideal below is recommended way to read the new saver files, below code in demo.py should fix, but
saver = tf.train.import_meta_graph(args.model+'.meta') saver.restore(sess, args.model)
But I ran into some other issues. what seem to solve it forcing the saver to V1 format in train.py
self.saver = tf.train.Saver(max_to_keep=100,write_version=tf.train.SaverDef.V1)
from tffrcnn.
thanks @rgsachin.
hello, did you mean modify self.saver = tf.train.Saver(max_to_keep=100) in train.py to self.saver = tf.train.Saver(max_to_keep=100,write_version=tf.train.SaverDef.V1) ?
In this way how should I restore the result file?(I am now training the kitti and waiting for the result file )
from tffrcnn.
Thanks for @CharlesShang your work.
I have trained KITTI dataset and get ckpt.meta, ckpt.index files, and I switch to CLASSES = ('background','person','bike','motorbike','car','bus') in demo.py, and import the meta graph
saver = tf.train.import_meta_graph(model) .
BUT I still can not test demo images, so I change self.saver = tf.train.Saver(max_to_keep=100) in train.py to self.saver = tf.train.Saver(max_to_keep=100,write_version=tf.train.SaverDef.V1) based on @rgsachin , after training again yielding real ckpt file, I fail to run demo again...
Could you give me some suggestions ? thanks
from tffrcnn.
@zyclarkcheng Did you solve the problem?could you help me ?I got the same problem
from tffrcnn.
Related Issues (20)
- Error compiling Cython file
- My GPU card doesn't support cuda,can I use your code?
- easydict HOT 1
- How to load tensorflow's new v2 format checkpoint? HOT 1
- Meet some problems when training on my own data. See below. HOT 3
- ZF_imagenet.npy file
- nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified HOT 2
- NameError: name 'xrange' is not defined HOT 1
- AttributeError: 'NoneType' object has no attribute 'model_checkpoint_path'
- demo.py HOT 2
- Nontype error when run demo and train HOT 4
- A question about anchors HOT 1
- How to load half of the trained model, then go to that point to train
- About BachNorm Layer
- deform_conv.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev HOT 1
- Compile Error
- I want to ask how i can get the model when i run the demo.py
- TypeError: 'NoneType' object is not subscriptable
- For getting more accuracy in faster rcnn , which parameters i have to tune (tuning parameters)
- potential bug in __init__.py
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 tffrcnn.