UOB-AI / UOB-AI.github.io

A repository to host our documentations website.
https://UOB-AI.github.io
1 stars 3 forks source link

model for Image deep clustering- using cifar10 dataset #26

Closed Amalsalem closed 1 year ago

Amalsalem commented 1 year ago

i am runining a model for deep autoencoder clustering using cifar10 dataset, after the pretraining phase, i run the model for the autoencoder thsi is the code: def predict_encoder(self, x): print('xxxxxx',x) x_encode = self.encoder.predict(x, verbose=1) print('x_encode',x_encode) return x_encode

and i get this error msg in the line of the x_encode = self.encoder.predict(x, verbose=1) ****

InternalError Traceback (most recent call last) Cell In[5], line 1 ----> 1 y_pred = model.train_second_phase_medmnist(x=x, y=y, kappa=1, n_clusters=10, maxiter=500, batch_size=40, tol=0.0, validate_interval=140, show_interval=200, save_interval=2800 , save_dir=save_dir, aug_train=True)

File ~/DynAE_Amal/DynAE.py:1824, in DynAE.train_second_phase_medmnist(self, x, y, kappa, n_clusters, maxiter, batch_size, tol, validate_interval, show_interval, save_interval, save_dir, aug_train) 1819 #wit best idx = index_array[index 10: min((index+1) 10, x.shape[0])] 1821 X_img = x[idx] -> 1824 x_emb = self.predict_encoder(x) 1825 Y_encoder = centers_embs[idx] 1827 #print('Y_encoder',Y_encoder)

File ~/DynAE_Amal/DynAE.py:396, in DynAE.predict_encoder(self, x) 393 def predict_encoder(self, x): 395 print('xxxxxx',x) --> 396 x_encode = self.encoder.predict(x, verbose=1) 397 print('x_encode',x_encode) 398 return x_encode

File /data/software/miniconda3/lib/python3.9/site-packages/keras/utils/traceback_utils.py:70, in filter_traceback..error_handler(*args, **kwargs) 67 filtered_tb = _process_traceback_frames(e.traceback) 68 # To get the full stack trace, call: 69 # tf.debugging.disable_traceback_filtering() ---> 70 raise e.with_traceback(filtered_tb) from None 71 finally: 72 del filtered_tb

File /data/software/miniconda3/lib/python3.9/site-packages/tensorflow/python/framework/constant_op.py:102, in convert_to_eager_tensor(value, ctx, dtype) 100 dtype = dtypes.as_dtype(dtype).as_datatype_enum 101 ctx.ensure_initialized() --> 102 return ops.EagerTensor(value, ctx.device_name, dtype)

InternalError: Failed copying input tensor from /job:localhost/replica:0/task:0/device:CPU:0 to /job:localhost/replica:0/task:0/device:GPU:0 in order to run _EagerConst: Dst tensor is not initialized.

Amalsalem commented 1 year ago

this is what i found about this issue :

This error message indicates that there was a problem converting a value to an eager tensor in TensorFlow. The error message specifically states that there was a problem copying an input tensor from the CPU to the GPU in order to run an operation.

One possible cause of this error could be a mismatch between the data type of the tensor and the expected data type for the operation. Another possible cause could be a problem with the GPU itself or with the TensorFlow installation.

To troubleshoot this issue, you may want to try the following steps:

Make sure that the data type of the tensor is compatible with the operation you are trying to run. Check that your GPU is properly installed and configured. You can try running other TensorFlow programs to see if the GPU works properly. Try reinstalling TensorFlow and any related dependencies. If none of these steps help, you may need to seek further assistance from the TensorFlow community or support team.

asubah commented 1 year ago

Can you share the notebook please? You can put it in the shared are under /data/datasets/ Also, if you surround your code and error messages with ``` you code ``` markdown will make them more readable.

long code or error message
Amalsalem commented 1 year ago

Awesome, thanks!

On Tue, May 16, 2023 at 10:29 AM Abdulla Subah @.***> wrote:

Closed #26 https://github.com/UOB-AI/UOB-AI.github.io/issues/26 as completed.

— Reply to this email directly, view it on GitHub https://github.com/UOB-AI/UOB-AI.github.io/issues/26#event-9254436302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AY3B76DAYLLB2UMNQH4J5ZLXGMUGBANCNFSM6AAAAAAXPWYYWM . You are receiving this because you modified the open/close state.Message ID: @.***>