Hello,
I want to use ivis
to do the analysis for my scRNA-seq data.
Here is my code:
def getReduction(X):
#X = PCA(n_components=4, copy=True, random_state=1).fit_transform(X)
from ivis import Ivis
model = Ivis(embedding_dims=4, k=15)
X = model.fit_transform(X)
print(X.shape)
return X
but I got some errors:
---------------------------------------------------------------------------
InternalError Traceback (most recent call last)
Input In [9], in <cell line: 1>()
----> 1 multi_train_x = getReduction(train_x)
Input In [8], in getReduction(X)
3 from ivis import Ivis
4 model = Ivis(embedding_dims=6, k=15)
----> 5 X = model.fit_transform(X)
6 print(X.shape)
7 return X
File /opt/conda/lib/python3.8/site-packages/ivis/ivis.py:368, in Ivis.fit_transform(self, X, Y, shuffle_mode)
349 def fit_transform(self, X, Y=None, shuffle_mode=True):
350 """Fit to data then transform
351
352 Parameters
(...)
365 Embedding of the data in low-dimensional space.
366 """
--> 368 self.fit(X, Y, shuffle_mode)
369 return self.transform(X)
File /opt/conda/lib/python3.8/site-packages/ivis/ivis.py:346, in Ivis.fit(self, X, Y, shuffle_mode)
328 def fit(self, X, Y=None, shuffle_mode=True):
329 """Fit an ivis model.
330
331 Parameters
(...)
343 Returns estimator instance.
344 """
--> 346 self._fit(X, Y, shuffle_mode)
347 return self
File /opt/conda/lib/python3.8/site-packages/ivis/ivis.py:318, in Ivis._fit(self, X, Y, shuffle_mode)
315 if self.verbose > 0:
316 print('Training neural network')
--> 318 hist = self.model_.fit(
319 datagen,
320 epochs=self.epochs,
321 callbacks=self.callbacks_ + [EarlyStopping(monitor='loss',
322 patience=self.n_epochs_without_progress)],
323 shuffle=shuffle_mode,
324 steps_per_epoch=int(np.ceil(X.shape[0] / self.batch_size)),
325 verbose=self.verbose)
326 self.loss_history_ += hist.history['loss']
File /opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py:67, in filter_traceback.<locals>.error_handler(*args, **kwargs)
65 except Exception as e: # pylint: disable=broad-except
66 filtered_tb = _process_traceback_frames(e.__traceback__)
---> 67 raise e.with_traceback(filtered_tb) from None
68 finally:
69 del filtered_tb
File /opt/conda/lib/python3.8/site-packages/tensorflow/python/eager/execute.py:54, in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
52 try:
53 ctx.ensure_initialized()
---> 54 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
55 inputs, attrs, num_outputs)
56 except core._NotOkStatusException as e:
57 if name is not None:
InternalError: Graph execution error:
Detected at node 'model_1/model/dense/MatMul' defined at (most recent call last):
File "/opt/conda/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/conda/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/opt/conda/lib/python3.8/site-packages/ipykernel_launcher.py", line 17, in <module>
app.launch_new_instance()
File "/opt/conda/lib/python3.8/site-packages/traitlets/config/application.py", line 846, in launch_instance
app.start()
File "/opt/conda/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 712, in start
self.io_loop.start()
File "/opt/conda/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 199, in start
self.asyncio_loop.run_forever()
File "/opt/conda/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
self._run_once()
File "/opt/conda/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
handle._run()
File "/opt/conda/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
File "/opt/conda/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 504, in dispatch_queue
await self.process_one()
File "/opt/conda/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 493, in process_one
await dispatch(*args)
File "/opt/conda/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 400, in dispatch_shell
await result
File "/opt/conda/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 724, in execute_request
reply_content = await reply_content
File "/opt/conda/lib/python3.8/site-packages/ipykernel/ipkernel.py", line 383, in do_execute
res = shell.run_cell(
File "/opt/conda/lib/python3.8/site-packages/ipykernel/zmqshell.py", line 528, in run_cell
return super().run_cell(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2880, in run_cell
result = self._run_cell(
File "/opt/conda/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2935, in _run_cell
return runner(coro)
File "/opt/conda/lib/python3.8/site-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
coro.send(None)
File "/opt/conda/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3134, in run_cell_async
has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
File "/opt/conda/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3337, in run_ast_nodes
if await self.run_code(code, result, async_=asy):
File "/opt/conda/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3397, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "/tmp/ipykernel_1917/2291785529.py", line 1, in <cell line: 1>
multi_train_x = getReduction(train_x)
File "/tmp/ipykernel_1917/2290316524.py", line 5, in getReduction
X = model.fit_transform(X)
File "/opt/conda/lib/python3.8/site-packages/ivis/ivis.py", line 368, in fit_transform
self.fit(X, Y, shuffle_mode)
File "/opt/conda/lib/python3.8/site-packages/ivis/ivis.py", line 346, in fit
self._fit(X, Y, shuffle_mode)
File "/opt/conda/lib/python3.8/site-packages/ivis/ivis.py", line 318, in _fit
hist = self.model_.fit(
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 64, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 1409, in fit
tmp_logs = self.train_function(iterator)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 1051, in train_function
return step_function(self, iterator)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 1040, in step_function
outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 1030, in run_step
outputs = model.train_step(data)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 889, in train_step
y_pred = self(x, training=True)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 64, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 490, in __call__
return super().__call__(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 64, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/base_layer.py", line 1014, in __call__
outputs = call_fn(inputs, *args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 92, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/functional.py", line 458, in call
return self._run_internal_graph(
File "/opt/conda/lib/python3.8/site-packages/keras/engine/functional.py", line 596, in _run_internal_graph
outputs = node.layer(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 64, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/training.py", line 490, in __call__
return super().__call__(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 64, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/base_layer.py", line 1014, in __call__
outputs = call_fn(inputs, *args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 92, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/functional.py", line 458, in call
return self._run_internal_graph(
File "/opt/conda/lib/python3.8/site-packages/keras/engine/functional.py", line 596, in _run_internal_graph
outputs = node.layer(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 64, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/engine/base_layer.py", line 1014, in __call__
outputs = call_fn(inputs, *args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 92, in error_handler
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/keras/layers/core/dense.py", line 221, in call
outputs = tf.matmul(a=inputs, b=self.kernel)
Node: 'model_1/model/dense/MatMul'
Attempting to perform BLAS operation using StreamExecutor without BLAS support
[[{{node model_1/model/dense/MatMul}}]] [Op:__inference_train_function_1703]
Thanks !!!