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

Open
Ashuradhipathi opened this issue Nov 2, 2024 · 0 comments · May be fixed by #2518
Open

Depreciated function name 'binom_test' of scipy. #2517

Ashuradhipathi opened this issue Nov 2, 2024 · 0 comments · May be fixed by #2518

Comments

@Ashuradhipathi
Copy link

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

@Ashuradhipathi Ashuradhipathi linked a pull request Nov 2, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant