Artificial Neural Networks and Deep Learning 2023 - Homework 1 Forum

Go back to competition Back to thread list Post in this thread

> Submission Issue

I have been getting this error since yesterday, but I cannot understand its meaning. This is the model.py file.
import os
import tensorflow as tf

class model:
def _init_(self, path):
self.model = tf.keras.models.load_model(os.path.join(path, 'efficientNetB4_ft'))

def predict(self, X):
normalized_x = X/255
out = self.model.predict(tf.keras.applications.efficientnet.preprocess_input(normalized_x*255))
out = tf.argmax(out, axis=-1) # Shape [BS]

return out

WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
2023-11-14 15:55:20.984626: I tensorflow/core/util/port.cc:111] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-11-14 15:55:21.019618: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2023-11-14 15:55:21.019645: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2023-11-14 15:55:21.019672: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-11-14 15:55:21.026279: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "/multiverse/storage/lattari/Prj/postdoc/Courses/AN2DL_2023/Competition1_running_dir/worker_gpu4_dir/tmp/codalab/tmpdgMpA8/run/program/score.py", line 130, in
M = model(submission_dir)
^^^^^^^^^^^^^^^^^^^^^
TypeError: model() takes no arguments

Posted by: gabrir99 @ Nov. 14, 2023, 4:12 p.m.

Is your "__init__" method correct? I think that you must double the underscores.

Posted by: an2dl.competitions @ Nov. 14, 2023, 5:02 p.m.
Post in this thread