"load_model" method causes operating system level user-interface freeze
@yeshsurya,
 It's unlikely for TF 2.6 version to receive any bug fixes except when we have security patches. There is a high possibility that this was fixed with later TF versions. Perhaps you can use latest tf versions for your case. 

Also I tried to execute the sample code with the latest tensorflow v2.13, and it was executed without any issue/error. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/d631e372dfef25faf51b50836c2933e4/save_and_load.ipynb).

Thank you! I think this is issue on GPU driver and Windows OS. When I switch the GPU mode from TCC to WDDM the freeze will not happen. I'm talking about NVIDIA A6000 GPU @yeshsurya,
In that case this is not the issue from the tensorflow side. I tried to execute the sample code with the latest tensorflow v2.13, and it was executed without any issue/error. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/d631e372dfef25faf51b50836c2933e4/save_and_load.ipynb).

Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/61464">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/61464">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

 2.6.2

### Custom code

Yes

### OS platform and distribution

Windows : 10.0.17763 

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

CUDA : 11.2.0_460.89 /CUDNN : 8.1.0.77

### GPU model and memory

NVIDIA RTX A6000

### Current behavior?

There should not be any user interface freeze

### Standalone code to reproduce the issue

```shell
load_m = tf.keras.models.load_model('test.hdf5',custom_objects={'custom_loss':CustomLossFunction})
```


### Relevant log output

```shell
We just see operating system user interface freeze.
When the GPU (NVIDIA RTX A6000 ) mode is TCC we see that whole user interface of operating system ( not just the process which is execution this command ) is frozen for 10 seconds. Can this be fixed so that there is no freeze of user interface ? 
Same code when GPU mode is WDDM will not freeze the user interface.
```
