首页 > 编程语言 >调用sdapi/v1/txt2img接口,报错“Couldn‘t load custom C++ ops”

调用sdapi/v1/txt2img接口,报错“Couldn‘t load custom C++ ops”

时间:2024-10-09 14:46:38浏览次数:3  
标签:load __ Couldn -- torch PyTorch version 报错 torchvision

后端启动stable_diffusion的api接口

nohup python launch.py  --use-cpu all --skip-torch-cuda-test    --api --api-log   --listen --server-name 192.168.1.204 > /home/third_party_app/llm/stable-diffusion-webui/logs/all.log 2>&1  &

服务接口

http://192.168.1.204:7860/docs

错误描述

Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.__version__ and your torchvision version with torchvision.__version__ and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

解决方案

  1. 原因:

遇到“Couldn't load custom C++ ops”这样的错误,通常意味着 PyTorch 和 torchvision 之间的版本不兼容。

检查版本兼容性:

import torch

import torchvision

print("PyTorch version:", torch.__version__)

print("Torchvision version:", torchvision.__version__)

重新安装 torchvision

pip uninstall torchvision

pip install torchvision

标签:load,__,Couldn,--,torch,PyTorch,version,报错,torchvision
From: https://blog.csdn.net/xinvictory/article/details/142786960

相关文章

  • nacos gateway 调用服务报错503 Server unavailable
    环境springboot3jdk17依赖<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-bootstrap</artifactId></dependency><dependency><groupId>org.springframe......
  • springboot-网站开发-thymeleaf引擎报错找不到指定的页面模板文件
    springboot-网站开发-thymeleaf引擎报错找不到指定的页面模板文件!这种错误的情况,发生,一般都是因为,我们自己的html模板文件,存档位置并不是在默认的templates下面。而是我们自己新建的一个子目录里面。然后,我们在java代码里面,控制器方法体内,return,返回模板的时候,我们多写了一个......
  • Error: Failed to download metadata for repo ‘update‘
    安装Rsync时报错:通常原因为从openEuler的官方仓库更新元数据时遇到超时或连接失败的问题。更换镜像源#移除旧的镜像源[[email protected]]#mv/etc/yum.repos.d/openEuler.repo/etc/yum.repos.d/openEuler.repo.bak#替换国产openEuler镜像源[root@nginx1yum......
  • C# WebService返回参数为DataTable报错“XML文档有错误”
    该问题由于DataTable列存在自定义类型。解决该报错需要以下几步:1、自定义类型增加xml序列化2、由于C#从XML反序列化DataSet或DataTable时的默认限制,所以需要先把调用方的项目开放限制,如果是.netframework项目,需要在app.config中添加<configuration><runtime>......
  • 安装VUE报错
    今年在安装脚手架的时候使用命令:npminstall-g@vue/cli发现报错:requesttohttps://registry.npm.taobao.org/@vue%2fclifailed,reason:certificatehasexpired证书已过期,查看了下旧的地址已经不适用了 接解决办法:1、查看下当前的下载源:npmconfiggetregistry2.设......
  • uniapp - HBuilderX运行到内置浏览器编译报错 ublic static TextAppearance_Holo_Smal
    前言网上的教程都无法解决问题,本文提供强力解决方案。在uniappH5网页开发中,报错提示:ublicstaticTextAppearance_Holo_Small:number;|SyntaxError:Unexpectedidentifier,非常恶心的错误,手机H5网站项目点击运行到内置浏览器后,瞬间报错且无法编译提示已停止运行,H5......
  • CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&
    CentOS报错:Couldnotretrievemirrorlisthttp://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32errorwas14:curl#6-"Couldnotresolvehost:mirrorlist.centos.org;Unknownerror"关于CentOS报错:Couldnotretrievemirr......
  • mysql数据库1045报错怎么解决
    遇到MySQL数据库 1045 报错(访问被拒绝,用户名或密码错误),可以通过以下步骤解决:1.确认用户名和密码检查用户名和密码:确认在连接数据库时输入的用户名和密码是否正确。尝试在命令行中连接数据库,确认是否能成功登录:bash mysql-uyour_username-p2.重置密码......
  • 常见问题解决 --- maven手动安装依赖jar包报错
    报错内容:执行命令mvninstall:install-file-DgroupId=com.beidouapp-DartifactId=SSDK-Dversion=4.0.2.0 -Dfile=C:\1\SSDK-Release-4.0.2.0.jar-Dpackaging=jar报错Unknownlifecyclephase“.ggstar“.Youmustspecifyavalidlifecyclephaseoragoal原因:在pow......
  • ubuntu更新报错Hash Sum mismatch
    查了一圈,应该是FW的问题,/etc/apt/sources.list更换成清华的源就可以了(阿里不行):debhttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/jammymainrestricteduniversemultiversedeb-srchttps://mirrors.tuna.tsinghua.edu.cn/ubuntu/jammymainrestricteduniversem......