Skip to content

Commit

Permalink
Remove Deprecation Warnings (#654)
Browse files Browse the repository at this point in the history
fixes #653
  • Loading branch information
lanpa authored Jan 23, 2022
1 parent eefcaa7 commit 9fe8b74
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
9 changes: 9 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@ license_file = LICENSE

[bdist_wheel]
universal = 1

[tool:pytest]
filterwarnings =
ignore:Call to deprecated create function FieldDescriptor
ignore:Call to deprecated create function Descriptor
ignore:Call to deprecated create function EnumDescriptor
ignore:Call to deprecated create function EnumValueDescriptor
ignore:Call to deprecated create function FileDescriptor
ignore:Call to deprecated create function OneofDescriptor
4 changes: 2 additions & 2 deletions tensorboardX/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def make_histogram(values, bins, max_bins=None):
limits = new_limits

# Find the first and the last bin defining the support of the histogram:
cum_counts = np.cumsum(np.greater(counts, 0, dtype=np.int32))
cum_counts = np.cumsum(np.greater(counts, 0))
start, end = np.searchsorted(cum_counts, [0, cum_counts[-1] - 1], side="right")
start = int(start)
end = int(end) + 1
Expand Down Expand Up @@ -510,7 +510,7 @@ def compute_curve(labels, predictions, num_thresholds=None, weights=None):

# Compute bins of true positives and false positives.
bucket_indices = np.int32(np.floor(predictions * (num_thresholds - 1)))
float_labels = labels.astype(np.float)
float_labels = labels.astype(float)
histogram_range = (0, num_thresholds - 1)
tp_buckets, _ = np.histogram(
bucket_indices,
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
flake8
pytest
torch
six
Expand Down
4 changes: 2 additions & 2 deletions tests/test_caffe2.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def filter_fn(blob):
def test_simple_cnnmodel(self):
model = cnn.CNNModelHelper("NCHW", name="overfeat")
workspace.FeedBlob("data", np.random.randn(1, 3, 64, 64).astype(np.float32))
workspace.FeedBlob("label", np.random.randn(1, 1000).astype(np.int))
workspace.FeedBlob("label", np.random.randn(1, 1000).astype(int))
with core.NameScope("conv1"):
conv1 = model.Conv("data", "conv1", 3, 96, 11, stride=4)
relu1 = model.Relu(conv1, conv1)
Expand Down Expand Up @@ -243,7 +243,7 @@ def test_simple_model(self):
model = model_helper.ModelHelper(name="mnist")
# how come those inputs don't break the forward pass =.=a
workspace.FeedBlob("data", np.random.randn(1, 3, 64, 64).astype(np.float32))
workspace.FeedBlob("label", np.random.randn(1, 1000).astype(np.int))
workspace.FeedBlob("label", np.random.randn(1, 1000).astype(int))

with core.NameScope("conv1"):
conv1 = brew.conv(model, "data", 'conv1', dim_in=1, dim_out=20, kernel=5)
Expand Down

0 comments on commit 9fe8b74

Please sign in to comment.