Open RMsu233 opened 1 year ago
存下来的权值没有结构的
存下来的权值没有结构的
我应该修改训练的部分对吗
不知能不能直接保存带结构的模型
您好,我将带结构的模型保存到本地了,但在转换模型时出现了错误 该错误似乎是由 mobilenet_v3.py 文件中 hard_swish 激活函数未知 导致的层错误
def hard_sigmoid(x):
return backend.relu(x + 3.0, max_value=6.0) / 6.0
def hard_swish(x):
return Multiply()([Activation(hard_sigmoid)(x), x])
def _make_divisible(v, divisor=8, min_value=None):
if min_value is None:
min_value = divisor
new_v = max(min_value, int(v + divisor / 2) // divisor * divisor)
# Make sure that round down does not go down by more than 10%.
if new_v < 0.9 * v:
new_v += divisor
return new_v
报错信息:
ValueError: Unknown activation function: hard_swish. Please ensure this object is passed to the custom_objects
argument.
您有什么解决办法吗
环境:
转换代码:
报错信息:
Traceback (most recent call last): File "h5py/h5t.pxd", line 14, in init h5py._conv File "h5py/h5t.pyx", line 293, in init h5py.h5t File "/home/rmsu233/anaconda3/envs/Tensorflow/lib/python3.8/site-packages/numpy/init.py", line 320, in getattr raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'typeDict'