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

Depreciated function name 'binom_test' of scipy. #2517

Closed
Ashuradhipathi opened this issue Nov 2, 2024 · 1 comment
Closed

Depreciated function name 'binom_test' of scipy. #2517

Ashuradhipathi opened this issue Nov 2, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Ashuradhipathi
Copy link
Contributor

Describe the bug
Depreciated function name 'binom_test' of scipy being called while running predict method of TensorFlowV2RandomizedSmoothing object. The function scipy.stats.binom_test() was removed from SciPy 1.12.0.

To Reproduce

  1. Create a TensorFlowV2Classifier classifier
classifier = TensorFlowV2Classifier(
    model=model,
    nb_classes=NUM_LABELS,
    input_shape=INPUT_SHAPE,
    loss_object=tf.keras.losses.CategoricalCrossentropy(from_logits=False),
    optimizer=tf.keras.optimizers.Adam(learning_rate=LR),
    clip_values=(0, 1)
) 
  1. Create a TensorFlowV2RandomizedSmoothing object using the classifier object
classifier_rs_025 = TensorFlowV2RandomizedSmoothing(model = classifier.model,
    nb_classes=NUM_LABELS,
    input_shape=INPUT_SHAPE,
    loss_object=tf.keras.losses.CategoricalCrossentropy(from_logits=False),
    optimizer=tf.keras.optimizers.Adam(learning_rate=LR),
    clip_values=(0, 1),
    sample_size=100,
    scale=0.25
)
  1. Call the predict method on a subset of images
    classifier_rs_025.predict(imgs_sub_test)

  2. See error

Expected behavior
Return predictions for the input images

Screenshots
image_2024-11-02_153654604

System information (please complete the following information):

  • Used Kaggle notebook

Note:

Proposed Solution:
Change The function name from binom_test to binomtest and handle the way the inputs and ouputs are returned

This solution worked out for me and i would like to contribute

@beat-buesser
Copy link
Collaborator

Hi @Ashuradhipathi Thank you very much for raising this issue and working on a solution!

@beat-buesser beat-buesser moved this to In Progress in ART 1.19.0 Dec 12, 2024
@beat-buesser beat-buesser moved this from In Progress to Done in ART 1.19.0 Dec 16, 2024
@beat-buesser beat-buesser closed this as completed by moving to Done in ART 1.19.0 Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
2 participants