RuntimeError: mixed dtype (CPU): expect parameter to have scalar type of Float
/home/user/.local/lib/python3.8/site-packages/torch/amp/autocast_mode.py:198: UserWarning: User provided device_type of ‘cuda’, but CUDA is not available. Disablingwarnings.warn(‘User provided device_type of 'cuda', but CUDA is not available. Disabling’)Traceback (most recent call last):File “/home/user/.local/lib/python3.8/site-packages/gradio/routes.py”, line 275, in run_predictoutput = await app.blocks.process_api(File “/home/user/.local/lib/python3.8/site-packages/gradio/blocks.py”, line 760, in process_apiresult = await self.call_function(fn_index, inputs, iterator)File “/home/user/.local/lib/python3.8/site-packages/gradio/blocks.py”, line 671, in call_functionprediction = await anyio.to_thread.run_sync(File “/home/user/.local/lib/python3.8/site-packages/anyio/to_thread.py”, line 31, in run_syncreturn await get_asynclib().run_sync_in_worker_thread(File “/home/user/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py”, line 937, in run_sync_in_worker_threadreturn await futureFile “/home/user/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py”, line 867, in runresult = context.run(func, *args)File “app.py”, line 106, in predictpreds = model(img.repeat(len(word_masks),1,1,1), word_masks)[0]File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_implreturn forward_call(*input, **kwargs)File “/home/user/app/clipseg/models/clipseg.py”, line 389, in forwardcond = self.get_cond_vec(conditional, bs)File “/home/user/app/clipseg/models/clipseg.py”, line 240, in get_cond_veccond = self.compute_conditional(conditional)File “/home/user/app/clipseg/models/clipseg.py”, line 261, in compute_conditionalcond = self.clip_model.encode_text(text_tokens)File “/home/user/.local/lib/python3.8/site-packages/clip/model.py”, line 348, in encode_textx = self.transformer(x)File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_implreturn forward_call(*input, **kwargs)File “/home/user/.local/lib/python3.8/site-packages/clip/model.py”, line 203, in forwardreturn self.resblocks(x)File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_implreturn forward_call(*input, **kwargs)File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/container.py”, line 139, in forwardinput = module(input)File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_implreturn forward_call(*input, **kwargs)File “/home/user/.local/lib/python3.8/site-packages/clip/model.py”, line 190, in forwardx = x + self.attention(self.ln_1(x))File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1130, in _call_implreturn forward_call(*input, **kwargs)File “/home/user/.local/lib/python3.8/site-packages/clip/model.py”, line 162, in forwardret = super().forward(x.type(torch.float32))File “/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/normalization.py”, line 189, in forwardreturn F.layer_norm(File “/home/user/.local/lib/python3.8/site-packages/torch/nn/functional.py”, line 2503, in layer_normreturn torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)RuntimeError: mixed dtype (CPU): expect parameter to have scalar type of Float‘’‘’’code:huggingface.coHugging Face – The AI community building the future.We’re on a journey to advance and democratize artificial intelligence through open source and open science.