Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit c095b85

Browse files
author
Ludwig Schubert
committed
Fix all remaining Python 2 incompatibilities. Ahem.
1 parent dda4605 commit c095b85

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

lucid/modelzoo/aligned_activations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lucid.misc.io import load
2020

2121
import numpy as np
22-
from functools import lru_cache
22+
from cachetools.func import lru_cache
2323

2424
PATH_TEMPLATE = "gs://modelzoo/aligned-activations/{}/{}-{:05d}-of-01000.npy"
2525
PAGE_SIZE = 10000

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from setuptools import setup, find_packages
2020

21-
version = "0.3.5"
21+
version = "0.3.6"
2222

2323
test_deps = ["future", "twine", "pytest", "pytest-mock", "python-coveralls"]
2424

@@ -64,6 +64,7 @@
6464
"pyopengl",
6565
"click",
6666
"filelock",
67+
"cachetools"
6768
],
6869
tests_require=test_deps,
6970
extras_require=extras,

tests/fixtures/arrays.npz

0 Bytes
Binary file not shown.

tests/modelzoo/test_vision_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_model_properties(name, model_class):
5959
assert hasattr(model_class, "layers")
6060
assert len(model_class.layers) > 0
6161
last_layer = model_class.layers[-1]
62-
assert last_layer['type'] == 'dense'
62+
assert 'dense' in last_layer.tags
6363
assert type(last_layer) == Layer
6464
assert last_layer.model_class == model_class
6565
assert hasattr(model_class, "name")

tests/recipes/test_activation_atlas.py tests/recipes/activation_atlas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def test_aligned_activation_atlas():
3131
atlasses = aligned_activation_atlas(
3232
model1, layer1, model2, layer2, number_activations=subset
3333
)
34-
path = f"tests/recipes/results/activation_atlas/aligned_atlas-{index}-of-{len(atlasses)}.jpg"
34+
path = "tests/recipes/results/activation_atlas/aligned_atlas-{}-of-{}.jpg".format(index, len(atlasses))
3535
for index, atlas in enumerate(atlasses):
3636
save(atlas, path)

0 commit comments

Comments
 (0)