Вот код, который используется для загрузки соответствующих пакетов вместе с функциями. < /P>
Код: Выделить всё
import os, json, joblib
from pathlib import Path
import warnings
warnings.filterwarnings("ignore")
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.utils.class_weight import compute_class_weight
from tensorflow.keras.utils import Sequence, to_categorical, pad_sequences
from tensorflow.keras.models import Model, load_model
from tensorflow.keras.layers import (
Input, Conv1D, BatchNormalization, Activation, add, MaxPooling1D, Dropout,
Bidirectional, LSTM, GlobalAveragePooling1D, Dense, Multiply, Reshape,
Lambda, Concatenate, GRU, GaussianNoise
)
from tensorflow.keras.regularizers import l2
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras import backend as K
import tensorflow as tf
import polars as pl
from sklearn.model_selection import StratifiedGroupKFold
from scipy.spatial.transform import Rotation as R
< /code>
Вот код, который используется для загрузки весов в модель. < /p>
PRETRAINED_DIR = Path("/kaggle/input/gesture_two_branch_mixup.h5/tensorflow2/default/1")
model = load_model(PRETRAINED_DIR / "gesture_two_branch_mixup.h5",
compile=False, custom_objects=custom_objs)
< /code>
Вот сообщение об ошибке. < /p>
2025-07-06 23:21:43.497389: E external/local_xla/xla/stream_executor/cuda/cuda_driver.cc:152] failed call to cuInit: INTERNAL: CUDA error: Failed call to cuInit: UNKNOWN ERROR (303)
Соответствующая информация включает:
tensorflow 2.18.0
< /code>
print(tf.sysconfig.get_build_info()['cuda_version'])
< /code>
Output of the above code (CUDA version):
12.5.1
< /code>
What should I do in this case?
I tried using the load_model function (as you can see) and got the UNKNOWN ERROR (303). I expected things to run without any error or warning.
Подробнее здесь: https://stackoverflow.com/questions/796 ... -error-303