from keras.metrics import top_k_categorical_accuracy
import pytest
import os
import sys

parentdir=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
from models import resnet_34, resnet_50

def _test_model_compile(model):
    model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['acc',top_k_categorical_accuracy])
    assert True, 'Failed to compile model.'

def test_resnet34():
    model = resnet_50(input_shape=(224, 224, 3), classes=102)
    _test_model_compile(model)

if __name__ == '__main__':
    pytest.main([__file__])
    

from keras.metrics import top_k_categorical_accuracy
import pytest
import os
import sys

parentdir=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
from models import resnet_34, resnet_50

def _test_model_compile(model):
    model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['acc',top_k_categorical_accuracy])
    assert True, 'Failed to compile model.'

def test_resnet34():
    model = resnet_50(input_shape=(224, 224, 3), classes=102)
    _test_model_compile(model)

if __name__ == '__main__':
    pytest.main([__file__])
    
