Keras with SQL Server 2019

Algotar, Kalpana A 1 Reputation point
2021-12-15T23:43:23.57+00:00

system configuration: python 3.7, tensorflow 2.7, keras 2.7
I am Trying to train keras model in SQL SERVER 2019 using the above configuration. The following error message is generated. Any suggestion to rectify the error.

Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
WARNING:root:Limited tf.summary API due to missing TensorBoard installation.
2021-12-15 15:34:25.942850: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2021-12-15 15:34:25.973528: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
2021-12-15 15:34:26.000976: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: RF3SDB672N2
2021-12-15 15:34:26.027152: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: RF3SDB672N2
Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
2021-12-15 15:34:26.038813: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

Error in execution. Check the output for more information.
Traceback (most recent call last):
File "<string>", line 5, in <module>
File "C:\ProgramData\SQL01\Temp-PY\Appcontainer1\957C64D5-DB8B-4556-A098-A0C91197BFEF\sqlindb_0.py", line 77, in transform
model.fit_generator(generator, steps_per_epoch=1, epochs=200, verbose=0)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1980, in fit_generator
initial_epoch=initial_epoch)

Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1153, in fit
steps_per_execution=self._steps_per_execution)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1394, in get_data_handler
return DataHandler(*args, **kwargs)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1161, in init
model=model)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 937, in init
**kwargs)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 809, in init

Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
peek = _process_tensorlike(peek)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1042, in _process_tensorlike
inputs = nest.map_structure(_convert_numpy_and_scipy, inputs)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\util\nest.py", line 869, in map_structure
structure[0], [func(*x) for x in entries],
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\util\nest.py", line 869, in <listcomp>
structure[0], [func(*x) for x in entries],
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1037, in _convert_numpy_and_scipy
return ops.convert_to_tensor_v2_with_dispatch(x, dtype=dtype)

Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\framework\constant_op.py", line 106, in convert_to_eager_tensor
return ops.EagerTensor(value, ctx.device_name, dtype)
ValueError: object array method not producing an array

SqlSatelliteCall error: Error in execution. Check the output for more information.
STDOUT message(s) from external script:
SqlSatelliteCall function failed. Please see the console output for more information.
Traceback (most recent call last):
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py", line 605, in rx_sql_satellite_call
rx_native_call("SqlSatelliteCall", params)
File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 375, in rx_native_call
ret = px_call(functionname, params)
RuntimeError: revoscalepy function failed.

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,237 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Algotar, Kalpana A 1 Reputation point
    2021-12-16T22:23:12.373+00:00

    Thanks for your response. I did the following things.

    1. I checked the location C:\Program Files\Microsoft SQL Server\MSSQL14.SQLSERVER2017\MSSQL\Log. but didnt find any log file.
    2. I copied nvcuda.dll and cudart64_110.dll in location: C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES. But still I am getting the following error message.

    First error is CUDA...On Server, we don't have NVIDIA GPU CARD and CUDA version should be compatible with NVIDIA CARD. Do you have any idea how to resolve the following error message?

    **2021-12-16 13:20:32.362718: **E tensorflow/stream_executor/cuda/cuda_driver.cc:271] failed call to cuInit: CUDA_ERROR_UNKNOWN: unknown error****

    Error in execution. Check the output for more information.
    Traceback (most recent call last):
    File "<string>", line 5, in <module>
    File "C:\ProgramData\SQL01\Temp-PY\Appcontainer1\859A66F0-607C-41F4-AEEC-0A8A6E678562\sqlindb_0.py", line 83, in transform
    model.fit_generator(generator, steps_per_epoch=1, epochs=200, verbose=0)

    Msg 39019, Level 16, State 2, Line 0
    An external script error occurred:
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1980, in fit_generator
    initial_epoch=initial_epoch)
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1153, in fit
    steps_per_execution=self._steps_per_execution)
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1394, in get_data_handler
    return DataHandler(*args, **kwargs)
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1161, in init
    model=model)

    Msg 39019, Level 16, State 2, Line 0
    An external script error occurred:
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 937, in init
    **kwargs)
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 809, in init
    peek = _process_tensorlike(peek)
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1042, in _process_tensorlike
    inputs = nest.map_structure(_convert_numpy_and_scipy, inputs)
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\util\nest.py", line 869, in map_structure
    structure[0], [func(*x) for x in entries],

    Msg 39019, Level 16, State 2, Line 0
    An external script error occurred:
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\util\nest.py", line 869, in <listcomp>
    structure[0], [func(*x) for x in entries],
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1037, in _convert_numpy_and_scipy
    return ops.convert_to_tensor_v2_with_dispatch(x, dtype=dtype)
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\tensorflow\python\framework\constant_op.py", line 106, in convert_to_eager_tensor
    return ops.EagerTensor(value, ctx.device_name, dtype)
    ValueError: object array method not producing an array

    Msg 39019, Level 16, State 2, Line 0
    An external script error occurred:
    SqlSatelliteCall error: Error in execution. Check the output for more information.
    STDOUT message(s) from external script:
    SqlSatelliteCall function failed. Please see the console output for more information.
    Traceback (most recent call last):
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py", line 605, in rx_sql_satellite_call
    rx_native_call("SqlSatelliteCall", params)
    File "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL01\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 375, in rx_native_call
    ret = px_call(functionname, params)
    RuntimeError: revoscalepy function failed.