Giter Site home page Giter Site logo

checkpoint_weights.hdf5 ??? about keras-fcn HOT 17 CLOSED

PEE8 avatar PEE8 commented on August 25, 2024
checkpoint_weights.hdf5 ???

from keras-fcn.

Comments (17)

JCamiloB21 avatar JCamiloB21 commented on August 25, 2024

did you find any solution?

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

i uninstalled anaconda and python and reinstalled anaconda and python 3.7
I did try to run all the files again
only two files transfer_FCN and inference is giving errors(new_1.docx)
once i fix them may be we can create HDF5 file

new_1.docx

from keras-fcn.

JCamiloB21 avatar JCamiloB21 commented on August 25, 2024

when you run transfer_FCN you must write the model in the terminal, for example python transfer_FCN Vgg16 or python transfer_FCN ResNet50

and I don't know what it's the error of inference, I'm try to run train.py but I have the error of the file HDF5

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

ok. but i am running the code on spyder so how do i give the command to run transfer_FCN Vgg16 or python transfer_FCN ResNet50?
are you running the same code of train.py from the keras-FCN link

from keras-fcn.

JCamiloB21 avatar JCamiloB21 commented on August 25, 2024

I tried in spyder and you need to go to run, configuration per file, general settings, you choose 'command line' and write Vgg16 or ResNet50

yes the same, I just change the paths to my dataset, classes and in the line of 'checkpoint_weights.hdf5 ' I wrote the file that your download of get_wieght_path and transfer_FCN

from keras-fcn.

JCamiloB21 avatar JCamiloB21 commented on August 25, 2024

It's normal , that is not a error, you need to wait

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

when i give ResNet50 in the command line of run

runfile('C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz/transfer_FCN.py', args='ResNet50', wdir='C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz')
Reloaded modules: get_weight_path2, resnet_helpers2
C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz/transfer_FCN.py:91: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(64, (7, 7), name="conv1", strides=(2, 2), padding="same")
x = Convolution2D(64, (7, 7), subsample=(2, 2), border_mode='same', name='conv1')(img_input)
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz/transfer_FCN.py', args='ResNet50', wdir='C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz')

File "C:\Users\Prisilla\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File "C:\Users\Prisilla\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz/transfer_FCN.py", line 148, in
func()

File "C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz/transfer_FCN.py", line 134, in transfer_FCN_ResNet50
if index.has_key(layer.name):

AttributeError: 'dict' object has no attribute 'has_key'

from keras-fcn.

JCamiloB21 avatar JCamiloB21 commented on August 25, 2024

look #3 there resolve that problem

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

yes . I did the same first i run get_weights_path.py and followed by transfer_FCN.py
still the above error.

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

https://stackoverflow.com/questions/33727149/dict-object-has-no-attribute-has-key
says 'has_key' is removed in python 3

from keras-fcn.

JCamiloB21 avatar JCamiloB21 commented on August 25, 2024

File "C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz/transfer_FCN.py", line 134, in transfer_FCN_ResNet50
if index.has_key(layer.name):

AttributeError: 'dict' object has no attribute 'has_key'

in the line 134 you need to write this code:

if layer.name in index:
                index[layer.name].set_weights(weights)

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

yes i did the same
and waiting for execution
will it take so long for execution
I closed everything and restarted but then it is taking long

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

runfile('C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz/transfer_FCN.py', args='ResNet50', wdir='C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz')
Reloaded modules: get_weight_path2, resnet_helpers2
C:/Users/Prisilla/Desktop/Semantics/keras_FCN/xyz/transfer_FCN.py:91: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(64, (7, 7), name="conv1", strides=(2, 2), padding="same")
x = Convolution2D(64, (7, 7), subsample=(2, 2), border_mode='same', name='conv1')(img_input)
Successfully transformed!

yes ! it worked finally (transfer_FCN.py for ResNet50)

from keras-fcn.

JCamiloB21 avatar JCamiloB21 commented on August 25, 2024

The model is fine, but in transfer_FCN in the Vgg16 method you need to change the same code

if layer.name in index:
                index[layer.name].set_weights(weights)

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

yes. i did for Vgg16 and ResNet50 method

My keras version is 2.2.2, is it because of keras version . I am getting userwarning

https://groups.google.com/forum/#!topic/keras-users/BT2ZA_8kBqQ
It says input_shape may be wrong

what is the keras version. you are working?

from keras-fcn.

PEE8 avatar PEE8 commented on August 25, 2024

train.py works with small error when i run after transfer_FCN ResNet50

==================================
Total params: 23,630,741
Trainable params: 23,577,621
Non-trainable params: 53,120


Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/Prisilla/Desktop/Semantics/keras_FCN/train2.py', wdir='C:/Users/Prisilla/Desktop/Semantics/keras_FCN')

File "C:\Users\Prisilla\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File "C:\Users\Prisilla\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Prisilla/Desktop/Semantics/keras_FCN/train2.py", line 233, in
label_suffix=label_suffix, ignore_label=ignore_label, label_cval=label_cval)

File "C:/Users/Prisilla/Desktop/Semantics/keras_FCN/train2.py", line 140, in train
steps_per_epoch = int(np.ceil(get_file_len(train_file_path) / float(batch_size)))

File "C:/Users/Prisilla/Desktop/Semantics/keras_FCN/train2.py", line 133, in get_file_len
fp = open(file_path)

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Prisilla/.keras/datasets/VOC2012/combined_imageset_train.txt'

==================================
Total params: 23,630,741
Trainable params: 23,577,621
Non-trainable params: 53,120


Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/Prisilla/Desktop/Semantics/keras_FCN/train2.py', wdir='C:/Users/Prisilla/Desktop/Semantics/keras_FCN')

File "C:\Users\Prisilla\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File "C:\Users\Prisilla\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Prisilla/Desktop/Semantics/keras_FCN/train2.py", line 233, in
label_suffix=label_suffix, ignore_label=ignore_label, label_cval=label_cval)

File "C:/Users/Prisilla/Desktop/Semantics/keras_FCN/train2.py", line 140, in train
steps_per_epoch = int(np.ceil(get_file_len(train_file_path) / float(batch_size)))

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Prisilla/.keras/datasets/VOC2012/combined_imageset_train.txt'

from keras-fcn.

JCamiloB21 avatar JCamiloB21 commented on August 25, 2024

I'm using Keras 2.2.0, Tensorflor 1.8 and python 3.6

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Prisilla/.keras/datasets/VOC2012/combined_imageset_train.txt'

that is the direction(path) of your dataset? because maybe the script doesn't found the dataset

from keras-fcn.

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.