nebuly-ai / optimate

A collection of libraries to optimise AI model performances
https://www.nebuly.com/
Apache License 2.0
8.37k stars 639 forks source link

yolov8 + nebuly | AttributeError: type object 'DummyClass' has no attribute 'models' #342

Open scraus opened 1 year ago

scraus commented 1 year ago

I tried reproducing the results in this notebook but I got the following errors:

image

saim212 commented 1 year ago

I'm facing the same error any solution?

vtl-btz commented 1 year ago

Got the same problem. As a workaround, you can use the previous speedster version !pip install speedster==0.2.1

also, I can't find the latest speedster code in this repository. Maybe it exists only in PyPi

I'm facing the same error any solution?

saim212 commented 1 year ago

Thanks for the response. now facing this issue.

     97         pred = [pred.cpu()]
     98     else:
---> 99         pred = [p.cpu() for p in pred]
    100     return pred
    101 

AttributeError: 'list' object has no attribute 'cpu'

Got the same problem. As a workaround, you can use the previous speedster version !pip install speedster==0.2.1

also, I can't find the latest speedster code in this repository. Maybe it exists only in PyPi

I'm facing the same error any solution?

valeriosofi commented 1 year ago

Hello, thank you for using speedster! We have just released speedster 0.4.0, where this issue is solved! Please update your local version by running pip install -U speedster and let me know if you have any other issues 😁

saim212 commented 1 year ago

with speedster==0.4.0 still facing the same issue. Screenshot from 2023-06-19 10-43-32

saim212 commented 1 year ago

python -m nebullvm.installers.auto_installer --compilers all the above command failed to install the following dependencies.

2023-06-19 05:30:44 | WARNING  | Unable to install torch_tensor_rt on this platform. The compiler will be skipped. 
2023-06-19 05:30:44 | INFO     | Trying to install faster_transformer on the platform...
2023-06-19 05:30:44 | WARNING  | Unable to install faster_transformer on this platform. The compiler will be skipped. 
valeriosofi commented 1 year ago

Hi @saim212, Can you share the notebook that you are using? I've just tried with the official one and It works correctly, you can try it here: YOLOv8 Notebook

valeriosofi commented 1 year ago

Hi @vtl-btz, you can find the speedster code here :)

Got the same problem. As a workaround, you can use the previous speedster version !pip install speedster==0.2.1

also, I can't find the latest speedster code in this repository. Maybe it exists only in PyPi

I'm facing the same error any solution?

saim212 commented 1 year ago

Hi @saim212, Can you share the notebook that you are using? I've just tried with the official one and It works correctly, you can try it here: YOLOv8 Notebook

Hello @valeriosofi, I tested your notebook. It's working fine but I was trying to optimize the yolov8s-pose model. There I faced this issue.

saim212 commented 1 year ago

For Yolov8-Pose model:

class YOLOWrapper(torch.nn.Module):
    def __init__(self, yolo_model):
        super().__init__()
        self.model = yolo_model.model

    def forward(self, x, *args, **kwargs):
        res = self.model(x)
        return res[0], *tuple(res[1][0])

model_wrapper = YOLOWrapper(yolo)

class OptimizedYOLO(torch.nn.Module):
    def __init__(self, optimized_model):
        super().__init__()
        self.model = optimized_model

    def forward(self, x, *args, **kwargs):
        res = self.model(x)
        return res[0], list(res[1][0:])

optimized_wrapper = OptimizedYOLO(optimized_model)