Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while loading weights #10

Open
pankaj-saha opened this issue Jun 2, 2020 · 1 comment
Open

Error while loading weights #10

pankaj-saha opened this issue Jun 2, 2020 · 1 comment

Comments

@pankaj-saha
Copy link

Load weights

from utils import load_weights
model = get_model()
load_weights(model,'yolo-tiny.weights')

Error:

/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:8: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(16, (3, 3), input_shape=(3, 448, 4..., strides=(1, 1), padding="same")

/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:13: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(32, (3, 3), padding="same")
del sys.path[0]
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:15: UserWarning: Update your MaxPooling2D call to the Keras 2 API: MaxPooling2D(pool_size=(2, 2), padding="valid")
from ipykernel import kernelapp as app

InvalidArgumentError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in _create_c_op(graph, node_def, inputs, control_inputs, op_def)
1653 try:
-> 1654 c_op = pywrap_tf_session.TF_FinishOperation(op_desc)
1655 except errors.InvalidArgumentError as e:

InvalidArgumentError: Negative dimension size caused by subtracting 2 from 1 for '{{node max_pooling2d_38/MaxPool}} = MaxPoolT=DT_FLOAT, data_format="NHWC", ksize=[1, 2, 2, 1], padding="VALID", strides=[1, 2, 2, 1]' with input shapes: [?,1,224,32].

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
14 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py in _create_c_op(graph, node_def, inputs, control_inputs, op_def)
1655 except errors.InvalidArgumentError as e:
1656 # Convert to ValueError for backwards compatibility.
-> 1657 raise ValueError(str(e))
1658
1659 return c_op

ValueError: Negative dimension size caused by subtracting 2 from 1 for '{{node max_pooling2d_38/MaxPool}} = MaxPoolT=DT_FLOAT, data_format="NHWC", ksize=[1, 2, 2, 1], padding="VALID", strides=[1, 2, 2, 1]' with input shapes: [?,1,224,32].

@gael-gao
Copy link

gael-gao commented Jan 5, 2021

I also meet the same type of error when I load weights:
ValueError: Negative dimension size caused by subtracting 2 from 1 for '{{node max_pooling2d/MaxPool}} = MaxPoolT=DT_FLOAT, data_format="NHWC", explicit_paddings=[], ksize=[1, 2, 2, 1], padding="VALID", strides=[1, 2, 2, 1]' with input shapes: [?,1,150,16].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants