I'm trying to train a network for different tasks, based on your project. The main issue I have is that if I create the same net with random weights instead of those from yolov3.weights (using this script: https://pastebin.com/RECciwrs) I get a net with the same number of params, the same layers, but on inference it outputs a matrix of NaNs. Since it outputs NaNs, I cannot train it, it will not converge to the desired weights.
For convenience, resize giraffe.jpg to 416x416 and rename as giraffe416.jpg
Run in terminal:
python
from keras.models import load_model
import numpy as np
import cv2
yolo = load_model('yolo.h5')
yolo_rw = load_model('yolo_random_weights.h5')
path = 'images/test/giraffe416.jpg'
image = cv2.imread(path)
image = np.array(image, dtype='float32')
image /= 255.
image = np.expand_dims(image, axis=0)
yolo.predict(image)
# will output a matrix of numbers
yolo_rw.predict(image)
# will output a matrix of NaNs
yolo_rw.set_weights(yolo.get_weights())
yolo_rw.predict(image)
# will output a matrix of numbers
Without using yolov3.weights, do you have any advice on how to seed the network so that it's trainable? I want to then use a different config file for a different number of classes in order to train.
Thank you.
Hello,
I'm trying to train a network for different tasks, based on your project. The main issue I have is that if I create the same net with random weights instead of those from yolov3.weights (using this script: https://pastebin.com/RECciwrs) I get a net with the same number of params, the same layers, but on inference it outputs a matrix of NaNs. Since it outputs NaNs, I cannot train it, it will not converge to the desired weights.
How to repro:
Without using yolov3.weights, do you have any advice on how to seed the network so that it's trainable? I want to then use a different config file for a different number of classes in order to train. Thank you.