Skip to content

Commit

Permalink
Fix import error and update test_losses.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMidtvedt committed Mar 14, 2024
1 parent a22a7d9 commit 00a0b9e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions deeptrack/test/test_losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@
# sys.path.append(".") # Adds the module to path

import unittest

from .. import losses

import numpy as np

has_required_modules = True

try:
import tensorflow as tf
from .. import losses
from tensorflow.keras import backend as K
except ImportError:
has_required_modules = False


class TestLosses(unittest.TestCase):

truthly = K.constant(np.ones((2, 2, 1)))
falsely = K.constant(np.zeros((2, 2, 1)))
truthly = K.constant(np.ones((2, 2, 1))) if has_required_modules else None
falsely = K.constant(np.zeros((2, 2, 1))) if has_required_modules else None

def test_flatten(self):
from tensorflow.keras.losses import mse
Expand Down

0 comments on commit 00a0b9e

Please sign in to comment.