Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: sfmig <33267254+sfmig@users.noreply.github.com>
  • Loading branch information
IgorTatarnikov and sfmig committed May 8, 2024
1 parent f578095 commit 8de63bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cellfinder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@


# If no backend is configured and installed for Keras, tools cannot be used
# Check backend is configured
# Check if backend is configured. If not, set to "torch"
if not os.getenv("KERAS_BACKEND"):
os.environ["KERAS_BACKEND"] = "torch"
warnings.warn("Keras backend not configured, automatically set to Torch")

# Check backend is installed
if os.getenv("KERAS_BACKEND") in ["tensorflow", "jax", "torch"]:
backend = os.getenv("KERAS_BACKEND")
backend = os.getenv("KERAS_BACKEND")
if backend in ["tensorflow", "jax", "torch"]:
try:
BACKEND_VERSION = version(backend)
except PackageNotFoundError as e:
raise PackageNotFoundError(
f"{backend}, ({backend}) set as Keras backend "
f"{backend} set as Keras backend "
f"but not installed"
) from e
else:
Expand Down
2 changes: 1 addition & 1 deletion cellfinder/core/classify/resnet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Callable, Dict, List, Literal, Optional, Tuple, Union

import keras.config
import keras
from keras import (
KerasTensor as Tensor,
)
Expand Down

0 comments on commit 8de63bd

Please sign in to comment.