File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
models/object_detection/retinanet Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 2222 namex = None
2323
2424
25- def maybe_register_serializable (symbol ):
25+ def maybe_register_serializable (symbol , package ):
2626 if isinstance (symbol , types .FunctionType ) or hasattr (symbol , "get_config" ):
27- keras .saving .register_keras_serializable (package = "keras_cv" )(symbol )
27+ keras .saving .register_keras_serializable (package = package )(symbol )
2828
2929
3030if namex :
3131
3232 class keras_cv_export (namex .export ):
33- def __init__ (self , path ):
33+ def __init__ (self , path , package = "keras_cv" ):
3434 super ().__init__ (package = "keras_cv" , path = path )
35+ self .package = package
3536
3637 def __call__ (self , symbol ):
37- maybe_register_serializable (symbol )
38+ maybe_register_serializable (symbol , self . package )
3839 return super ().__call__ (symbol )
3940
4041else :
4142
4243 class keras_cv_export :
43- def __init__ (self , path ):
44- pass
44+ def __init__ (self , path , package = "keras_cv" ):
45+ self . package = package
4546
4647 def __call__ (self , symbol ):
47- maybe_register_serializable (symbol )
48+ maybe_register_serializable (symbol , self . package )
4849 return symbol
Original file line number Diff line number Diff line change 1717from keras_cv .api_export import keras_cv_export
1818
1919
20- # TODO(scottzhu): Register it later due to the conflict in the retinanet
21- # @keras.utils.register_keras_serializable(package="keras_cv")
2220@keras_cv_export ("keras_cv.layers.FeaturePyramid" )
2321class FeaturePyramid (keras .layers .Layer ):
2422 """Implements a Feature Pyramid Network.
Original file line number Diff line number Diff line change 1717from keras_cv .backend import ops
1818
1919
20- @keras_cv_export ("keras_cv.models.retinanet.FeaturePyramid" )
20+ @keras_cv_export (
21+ "keras_cv.models.retinanet.FeaturePyramid" ,
22+ package = "keras_cv.models.retinanet" ,
23+ )
2124class FeaturePyramid (keras .layers .Layer ):
2225 """Builds the Feature Pyramid with the feature maps from the backbone."""
2326
You can’t perform that action at this time.
0 commit comments