Tensorflow compatibility with pyinstaller
Hi **@Bhavi-cd** ,

- Ensure that the version of PyTorch used by Ultralytics (indirectly through YOLO) is compatible with the other components in your environment. If possible, try downgrading or upgrading PyTorch to a version that is known to work well with YOLOv8-obb and your other dependencies.
- Verify if the version of Ultralytics (8.2.2) you are using is compatible with the specific version of YOLOv8-obb you have trained. Sometimes, newer or older versions of object detection frameworks like YOLO may not work seamlessly with the corresponding versions of their supporting libraries. And et us know if the issue still persists?


Thank you! Hi @Venkat6871 
I have tried downgrading the version, also when I run the .py file it is running perfectly but when I convert it to .exe these problem occur.
### Issue type

Support

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

No

### Source

source

### TensorFlow version

2.16.1

### Custom code

Yes

### OS platform and distribution

Windows

### Mobile device

_No response_

### Python version

3.11.9

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I have encountered a problem while running my custom trained YOLOv8-obb model for object detection using an executable (.exe) file generated with PyInstaller. The model loads properly, but when attempting to perform inference, the code halts without providing any output.

Steps to Reproduce:

    Compile YOLOv8-obb model with custom training data.
    Generate an executable file using PyInstaller.
    Run the executable file on a machine with compatible dependencies.
    Attempt object detection using the executable.

### Standalone code to reproduce the issue

```shell
##current behavior 

After running the executable, I expect the object detection process to proceed smoothly and provide the desired output, identifying objects in the input images or videos.

## Actual Behavior 

Upon running the executable, the model loads successfully but fails to perform inference. The code halts without providing any output, leaving the object detection process incomplete.

`PyInstaller :6.6.0`
`Ultralytics: 8.2.2`

    I have tried running the code directly without PyInstaller to ensure it's not an issue with the model or code itself.
    I have checked for any missing dependencies or compatibility issues between PyInstaller and the YOLOv8-obb model.    I have tried running the code directly without PyInstaller to ensure it's not an issue with the model or code itself.
    I have checked for any missing dependencies or compatibility issues between PyInstaller and the YOLOv8-obb model.
```


### Relevant log output

```shell
import logging
from logging.handlers import RotatingFileHandler
import time
from ultralytics import YOLO
import cv2

# Configure logging with rotation
log_formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
file_handler = RotatingFileHandler(r'log_files\test_log_test.log', maxBytes=1024 * 1024 * 5, backupCount=5)  # Rotate every 5MB, keep 5 backups
file_handler.setFormatter(log_formatter)
logger = logging.getLogger('test_log_test')
logger.setLevel(logging.INFO)
logger.addHandler(file_handler)

cnt = 0
while True:
    cnt+=1
    try:
        logger.info(cnt)
        logger.info("service test working")
        time.sleep(10)

        model = YOLO(r"weights\best(100epoch).pt")
        model.fuse()
        logger.info("yolo done")

        img_path = r"test_image.jpg"
        img = cv2.imread(img_path)
        logger.info("reading image")
        cv2.imwrite(r"test_image_output.jpg",img)
        logger.info("writing image")
        results = model.predict(img_path)

        logger.info("prediction doness")
    except Exception as e:
        # Log error
        logger.error(f"Error occurred : {e}")




# Logs


```
124851 WARNING: Failed to collect submodules for 'keras.src.backend.torch' because importing 'keras.src.backend.torch' raised: AttributeError: module 'torch' has no attribute 'float8_e4m3fn'
```
```
