fizyr / keras-retinanet

Keras implementation of RetinaNet object detection.
Apache License 2.0
4.38k stars 1.96k forks source link

Project dependencies may have API risk issues #1583

Closed PyDeps closed 1 year ago

PyDeps commented 1 year ago

Hi, In keras-retinanet, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

keras-resnet==0.2.0
keras
matplotlib
numpy>=1.14
pillow
progressbar2

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project, The version constraint of dependency keras can be changed to >=2.0.9,<=2.3.1.

The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

In version keras-2.4.0, the API keras.utils.multi_gpu_model whch is used by the current project in keras_retinanet/bin/train.py is missing.

image
The calling methods from the keras
keras.utils.multi_gpu_model
The calling methods from the all methods
utils.config.read_config_file
keras_resnet.models.ResNet101
tensorflow.unstack
backbone_retinanet
numpy.meshgrid
pycocotools.cocoeval.COCOeval.accumulate
num_values.keras.layers.Reshape
default_classification_model
self.resize_image
efficientnet.keras.EfficientNetB7
self.classes.items
allowed_backbones.keys
layers.RegressBoxes
parallel_iterations.max_detections.score_threshold.nms_threshold.class_specific_filter.nms.layers.FilterDetections
keras_retinanet.utils.visualization.draw_box
keras_retinanet.models.load_model.predict_on_batch
num_classes.keras.layers.Reshape
self.FilterDetections.super.get_config.update
tensorflow.keras.backend.abs
tensorflow.keras.backend.argmax
utils.image.resize_image
callable
retinanet
xml_root.iter
utils.anchors.compute_gt_annotations
tensorflow.keras.layers.Activation
self.std.tolist
self.num_classes
numpy.delete
index.annotations_group.keys
self.coco.loadImgs
self.__parse_annotations
tensorflow.keras.backend.int_shape
layer.compute_output_shape
pycocotools.cocoeval.COCOeval
tensorflow.keras.applications.VGG16
tensorflow.keras.models.Model
default_submodels
retinanet.retinanet.get_layer
_parse
matplotlib.pyplot.show
type
line.strip.split
cv2.resize
precisions.append
efficientnet.keras.EfficientNetB6
shift_y.ravel.shift_x.ravel.shift_y.ravel.shift_x.ravel.np.vstack.transpose
tensorflow.image.non_max_suppression
os.path.isabs
self.coco.loadAnns
self.compute_anchor_targets
numpy.expand_dims
format.format
numpy.empty
create_generator.label_to_name
tensorflow.keras.backend.max
dict.keys
os.path.relpath
subparsers.add_parser.add_argument
self.backbone.split.replace
tensorflow.keras.backend.stack
self.image_path
utils.anchors.anchors_for_shape
keras_retinanet.utils.image.read_image_bgr
tensorflow.keras.backend.shape
load_hierarchy
visualization.draw_annotations
tensorflow.map_fn
argparse.ArgumentParser
self.group_images
utils.gpu.setup_gpu
keras.utils.multi_gpu_model
_uniform
random.shuffle
tensorflow.keras.backend.sum
model.predict_on_batch
create_generator.load_image
numpy.clip
keras_retinanet.utils.gpu.setup_gpu
tensorflow.nn.top_k
tensorflow.ones
transform.dot.min
adjust_saturation
sys.path.insert
self.classes.keys
models.convert_model
efficientnet.keras.EfficientNetB3
feature_size.keras.layers.Conv2D
self.__parse_annotation
coco_true.loadRes
models.convert_model.save
cv2.imshow
layers.UpsampleLike
tensorflow.keras.layers.Conv2D
tensorflow.keras.optimizers.Adam
total_instances.append
round
generator.preprocess_image
tensorflow.config.experimental.set_memory_growth
setattr
self.compute_targets
preprocessing.open_images.OpenImagesGenerator
utils.visualization.draw_boxes
layers.FilterDetections
self.custom_objects.update
image_ids.append
utils.config.parse_anchor_parameters
os.path.splitdrive
tensorflow.keras.backend.cast.set_shape
self.load_classes
self._command.finalize_options
utils.visualization.draw_caption
tensorflow.keras.backend.concatenate
utils.image.random_visual_effect_generator
self.size
modifier
utils.config.parse_pyramid_levels
tensorflow.where
numpy.maximum
models.check_training_model
matplotlib.pyplot.axis
self._command.initialize_options
callbacks.coco.CocoEval
effnet_retinanet
self.validate
find_hierarchy_parent
self.FilterDetections.super.__init__
ord
range
utils.coco_eval.evaluate_coco
numpy.vstack
generator.resize_image
tensorflow.keras.backend.not_equal
parse
cv2.waitKeyEx
__build_model_pyramid
utils.transform.transform_aabb
generator.label_to_coco_label
utils.image.preprocess_image
tensorflow.summary.create_file_writer.as_default
utils.image.read_image_bgr
vgg_retinanet
self.image_aspect_ratio
progressbar.progressbar
numpy.argsort
numpy.tile
self.callback.on_epoch_begin
row.replace.replace.replace
random_transform
_read_annotations
cv2.namedWindow
shapes_callback
self.preprocess_image_func
_open_for_csv
numpy.cos
os.path.isdir
utils.tf_version.check_tf_version
shift_y.ravel.shift_x.ravel.shift_y.ravel.shift_x.ravel.np.vstack.transpose.reshape
box.astype
keras_retinanet.utils.image.preprocess_image
options.i.format.regression_feature_size.keras.layers.Conv2D
filtered_boxes.append
cv2.warpAffine
tensorflow.keras.callbacks.EarlyStopping
creator
numpy.zeros.reshape
create_generator.random_visual_effect_group_entry
efficientnet.keras.EfficientNetB0
tensorflow.keras.backend.equal
os.path.basename
tensorflow.keras.callbacks.ModelCheckpoint
numpy.finfo
self.callback.set_model
create_generator.resize_image
random_translation
shift
keras_retinanet.utils.colors.label_color
tensorflow.summary.create_file_writer.flush
os.path.exists
configparser.ConfigParser.read_file
adjust_contrast
self.callback.on_train_begin
compute_gt_annotations
generator.load_image
tensorflow.pad
self.compute_inputs
VisualEffect
self.filter_annotations
numpy.sqrt
transform.dot.max
translation
tensorflow.keras.backend.less
backend.bbox_transform_inv
transform.change_transform_origin
numpy.random.RandomState
tuple
backbone
self.load_image
sum
shapes.extend
self.preprocess_image
tensorflow.keras.backend.ones_like
rotation
self.include_dirs.append
preprocessing.coco.CocoGenerator
json.loads
tensorflow.config.set_visible_devices
argparse.ArgumentParser.add_argument
self.mean.tolist
retinanet.retinanet_bbox
tensorflow.keras.backend.cast
tensorflow.keras.layers.Reshape
float
layers.Anchors
params.cvBorderMode
utils.image.adjust_transform_for_image
self.KittiGenerator.super.__init__
f.read
_generate
tensorflow.keras.backend.floatx
self.FilterDetections.super.get_config
xml.etree.ElementTree.parse.getroot
o.set_shape
layer_shapes
compute_resize_scale
tensorflow.summary.scalar
tensorflow.compat.v1.image.resize_images
self.scales.tolist
file_name.format
setuptools.command.build_ext.build_ext
average_precisions.items
int
preprocessing.kitti.KittiGenerator
_filter_detections
tensorflow.version.VERSION.split.split
self.RegressBoxes.super.get_config
create_pyramid_features
getattr
losses.focal
numpy.stack
self.coco.getAnnIds
open
dict.items
model
numpy.repeat
pycocotools.coco.COCO
get_labels
tensorflow.keras.backend.reshape
enumerate
matplotlib.pyplot.figure
tensorflow.keras.backend.tile
classifier
tensorflow.TensorSpec
math.log
xml.etree.ElementTree.parse
densenet_retinanet
fn.replace
random_rotation
self.RegressBoxes.super.__init__
numpy.sum
callbacks.eval.Evaluate
generator.size
tensorflow.keras.initializers.RandomNormal
tf_version
generate_images_annotations_json
transform.dot
numpy.concatenate
create_models
zip
random_flip
self.SeBackbone.super.__init__
self.RegressBoxes.super.get_config.update
models.backbone
classification_models.keras.Classifiers.get
format
tensorflow.keras.backend.greater
self.load_annotations
self.callback.on_epoch_end
effnet.EfficientNetBackbone
boxes.append
utils.anchors.generate_anchors
generator.num_classes
self.load_image_group
numpy.logical_or
xml_root.findall
K.shifts.reshape.transpose
bbox_transform
time.time
six.raise_from
generate_anchors
models.load_model
generator.load_annotations
makedirs
cv2.cvtColor.mean
label_to_name
create_generators
numpy.arange.ravel
join
draw_box
tensorflow.keras.backend.binary_crossentropy
model_with_weights
backend.shift
numpy.linalg.multi_dot
keras_retinanet.utils.visualization.draw_caption
os.path.splitext
img_file.result.append
annotations.copy
retinanet.get_layer
assert_training_model
self.scales.self.ratios.self.size.utils_anchors.generate_anchors.astype
cv2.rectangle
utils.image.apply_transform
numpy.zeros.astype
self.Anchors.super.__init__
initializers.PriorProbability
utils.eval.evaluate
efficientnet.keras.preprocess_input
kwargs.pop
set
super
len
print
utils.anchors.AnchorParameters.default.num_anchors
list.sort
tensorflow.keras.applications.mobilenet.MobileNet
self.compute_input_output
keras_retinanet.utils.image.resize_image
_read_classes
self.preprocess_group
tensorflow.keras.backend.ones
set_name.data_dir.os.path.join.open.readlines
tensorflow.keras.layers.Add
tensorflow.keras.backend.constant
random_scaling
tensorflow.keras.backend.maximum
tensorflow.keras.backend.transpose
json.dump
self.on_epoch_end
self.coco_label_to_label
self.random_visual_effect_group
_random_vector
self.Anchors.super.get_config
matplotlib.pyplot.imshow
self.image_data.keys
mobilenet_retinanet
cv2.putText
name.keras.layers.Concatenate
models.retinanet.retinanet_bbox
self.name_to_label
PIL.Image.open
adjust_brightness
f.read.split
keras_retinanet.utils.image.preprocess_image.copy
default_regression_model
create_generator
random_shear
numpy.prod
self.random_transform_group_entry
find_hierarchy_parent.append
os.path.dirname
tensorflow.keras.backend.arange
senet_retinanet
pycocotools.cocoeval.COCOeval.summarize
self._command.run
warnings.warn
detected_annotations.append
generator.load_image.copy
numpy.random.RandomState.uniform
__build_anchors
tensorflow.keras.utils.get_file
utils.anchors.AnchorParameters
self.coco.loadCats.sort
tensorflow.config.list_physical_devices
function
parent.find
self.preprocess_group_entry
self.images.append
_clip
self.random_transform_group
keras_resnet.models.ResNet50
row.replace.replace
models.load_model.summary
tensorflow.keras.models.load_model
_check_range
tensorflow.keras.backend.cast_to_floatx
preprocessing.pascal_voc.PascalVocGenerator
options.prior_probability.initializers.PriorProbability.keras.initializers.RandomNormal.num_anchors.num_classes.keras.layers.Conv2D
self.callback.on_train_end
anchors.compute_overlap
setuptools.find_packages
options.num_values.num_anchors.keras.layers.Conv2D
row.replace
_get_annotations
pycocotools.cocoeval.COCOeval.evaluate
self.callback.on_batch_end
efficientnet.keras.EfficientNetB1
self.CocoGenerator.super.__init__
make_output_path
utils.anchors.AnchorParameters.default.__dict__.keys
generator.has_label
preprocessing.csv_generator.CSVGenerator
tensorflow.pad.set_shape
self.PascalVocGenerator.super.__init__
self.label_to_name
x.astype.astype
utils.compute_overlap.compute_overlap
_findNode
options.keras.initializers.RandomNormal.i.format.classification_feature_size.keras.layers.Conv2D
modifier.get_layer
tensorflow.keras.backend.minimum
main
self.__filter_data
modifier.split
line.strip
create_generator.load_annotations
self.coco.getImgIds
utils.transform.random_transform_generator
resnet_retinanet
argparse.ArgumentParser.add_subparsers
image.mean.mean
numpy.sin
image.np.clip.astype
numpy.argmax
tensorflow.version.VERSION.split
tensorflow.keras.applications.VGG19
_compute_ap
utils.config.parse_anchor_parameters.num_anchors
numpy.array
anchor_params.num_anchors
Exception
create_callbacks.append
NotImplementedError
annotations.astype
numpy.arange
retinanet.retinanet
tensorflow.keras.layers.Input
setuptools.extension.Extension
tensorflow.keras.backend.image_data_format
csv.reader
parse_args
argparse.ArgumentParser.parse_args
isinstance
numpy.ascontiguousarray
parser.add_mutually_exclusive_group.add_argument
numpy.empty.append
create_callbacks
all
self.coco.loadCats
label.annotations.annotations.copy
resnet_filename.format
self.RedirectModel.super.__init__
tensorflow.gather_nd
tensorflow.config.list_logical_devices
self.CSVGenerator.super.__init__
configparser.ConfigParser
utils.anchors.make_shapes_callback
create_generator.random_transform_group_entry
tensorflow.clip_by_value
self.Evaluate.super.__init__
string.split
argparse.ArgumentParser.add_mutually_exclusive_group
self.ratios.tolist
tensorflow.meshgrid
keras_retinanet.models.load_model
self.EfficientNetBackbone.super.__init__
next
params.cvInterpolation
backend.resize_images
utils.visualization.draw_annotations
tensorflow.keras.layers.Permute
list
setuptools.setup
adjust_hue
visual_effect
tensorflow.keras.layers.Concatenate
numpy.zeros
keras.utils.multi_gpu_model.compile
tensorflow.keras.backend.pow
map
_get_detections
image.transpose.transpose
cv2.imwrite
preprocessing.kitti.KittiGenerator.num_classes
self.generator.label_to_name
self.OpenImagesGenerator.super.__init__
fmt.format
image_batch.transpose.transpose
positive_indices.argmax_overlaps_inds.annotations.astype
check_args
dict
self.load_annotations_group
run
all_anchors.reshape.reshape
__build_pyramid
parser.add_subparsers.add_parser
models.load_model.load_weights
numpy.cumsum
utils.image.TransformParameters
self.classes.values
load_hierarchy_children
tensorflow.keras.callbacks.ReduceLROnPlateau
numpy.append
models.backbone.download_imagenet
configparser.ConfigParser.split
self.backbone.split
filter_detections
self.ResNetBackbone.super.__init__
draw_caption
visualization.draw_detections
scaling
box.np.array.astype
csv.DictReader
backend.map_fn
self.callback.on_batch_begin
efficientnet.keras.EfficientNetB2
colors.label_color
cv2.cvtColor
max
os.makedirs
keras.utils.multi_gpu_model.fit_generator
keras_resnet.models.ResNet152
tf_version_ok
AnchorParameters
create_generator.image_path
callbacks.RedirectModel
tensorflow.keras.backend.expand_dims
self.coco.getCatIds
layers.ClipBoxes
os.path.join
ValueError
tensorflow.device
tensorflow.summary.create_file_writer
numpy.random.uniform
numpy.get_include
os.listdir
gpu_id.split
tensorflow.keras.backend.gather
numpy.where
collections.OrderedDict
results.append
efficientnet.keras.EfficientNetB4
path.Image.open.convert
box.tolist
tensorflow.transpose
sys.exit
all_indices.append
create_generator.size
shear
i.format.anchor_parameters.scales.anchor_parameters.ratios.i.anchor_parameters.strides.i.anchor_parameters.sizes.layers.Anchors
min
tensorflow.keras.callbacks.TensorBoard
efficientnet.keras.EfficientNetB5
self.random_visual_effect_group_entry
self.backbone.replace
self.CocoEval.super.__init__
self.generate_anchors
assert_tf_version
numpy.mod
losses.smooth_l1

@developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.

hgaiser commented 1 year ago

Absolutely, feel free to submit a PR.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale due to the lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.