Comments (7)
你好我运行测试命令的时候报错,请问您有遇到吗:python inference_tag2text.py --image 042.jpg --pretrained tag2text_swin_14m.pth 报错: magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.
你的这个报错我没有遇到,我倒是遇到了另一个报错
Traceback (most recent call last): File "inference_tag2text.py", line 94, in <module> res = inference(image, model, args.specified_tags) File "inference_tag2text.py", line 43, in inference caption, tag_predict = model.generate(image, File "/data2/home/tyu/stable_diffusion/promt_gen/Recognize_Anything-Tag2Text/models/tag2text.py", line 364, in generate torch.sigmoid(logits) > self.class_threshold, RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!因为我是在显卡上跑的,所以遇到这样的报错,可以通过将对应的代码
修改为
torch.sigmoid(logits) > self.class_threshold.to(image.device),就行了,小问题 @Coler1994 @xinyu1205
感谢你非常有价值的bug反馈,我已经修改对应的代码~
from recognize-anything.
你好我运行测试命令的时候报错,请问您有遇到吗:python inference_tag2text.py --image 042.jpg --pretrained tag2text_swin_14m.pth 报错: magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.
你的这个报错我没有遇到,我倒是遇到了另一个报错
Traceback (most recent call last):
File "inference_tag2text.py", line 94, in <module>
res = inference(image, model, args.specified_tags)
File "inference_tag2text.py", line 43, in inference
caption, tag_predict = model.generate(image,
File "/data2/home/tyu/stable_diffusion/promt_gen/Recognize_Anything-Tag2Text/models/tag2text.py", line 364, in generate
torch.sigmoid(logits) > self.class_threshold,
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
因为我是在显卡上跑的,所以遇到这样的报错,可以通过将对应的代码
https://github.com/xinyu1205/Recognize_Anything-Tag2Text/blob/ffd1a283caea70ab8436645c0fd0f366ae7de3f8/models/tag2text.py#L364
修改为
torch.sigmoid(logits) > self.class_threshold.to(image.device),
就行了,小问题
@Coler1994 @xinyu1205
from recognize-anything.
是
model.threshold
由0.68降到了0.64?我刚才改了但是好像没起到作用。还是其他哪个参数?谢谢
应该只是阈值问题,我这儿降到0.63能出lamp
,door
还要更低些
from recognize-anything.
demo为了保证准确率,调高了阈值,牺牲了些召回,
grounded sam的pipeline由于有grounding dino兜底,阈值会偏低些。
我们在精细的调调每个类的阈值。
from recognize-anything.
是model.threshold
由0.68降到了0.64?我刚才改了但是好像没起到作用。还是其他哪个参数?谢谢
from recognize-anything.
你好我运行测试命令的时候报错,请问您有遇到吗:python inference_tag2text.py --image 042.jpg --pretrained tag2text_swin_14m.pth
报错:
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.
from recognize-anything.
你好我运行测试命令的时候报错,请问您有遇到吗:python inference_tag2text.py --image 042.jpg --pretrained tag2text_swin_14m.pth 报错: magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.
你的这个报错我没有遇到,我倒是遇到了另一个报错
Traceback (most recent call last): File "inference_tag2text.py", line 94, in <module> res = inference(image, model, args.specified_tags) File "inference_tag2text.py", line 43, in inference caption, tag_predict = model.generate(image, File "/data2/home/tyu/stable_diffusion/promt_gen/Recognize_Anything-Tag2Text/models/tag2text.py", line 364, in generate torch.sigmoid(logits) > self.class_threshold, RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!因为我是在显卡上跑的,所以遇到这样的报错,可以通过将对应的代码
修改为
torch.sigmoid(logits) > self.class_threshold.to(image.device),就行了,小问题 @Coler1994 @xinyu1205
谢谢,发现问题了是模型文件没clone好,谢谢你的回复
from recognize-anything.
Related Issues (20)
- The pre-trained checkpoint HOT 1
- pre_caption function
- 4M version checkpoint HOT 1
- Can i inference RAM to output text? HOT 2
- RuntimeError: checkpoint url or path is invalid HOT 1
- 一个tag对应tag_chinese多个标签,如"table"==“桌子/表格”,如何过滤标签 HOT 6
- Error while running inference_ram_plus.py HOT 2
- generative tagging HOT 1
- Is `loss_t2t` in RAM necessary? Can I just remove it? HOT 7
- Finetuning question HOT 7
- Some questions about fine-tuning recognize-anything model HOT 1
- Relax transformers dependency version HOT 3
- Why is the tag and Caption text predicted by Tag2Text different? Why didn't Tag2Text use specific tags given by user?
- about training 4M dataset and the loss converge slowly HOT 3
- A question on embedding
- NameError: name '_C' is not defined HOT 1
- VisionTransformer undefined in ram.models.utils.py
- HuggingFace App is not working HOT 1
- Uncertain output results
- 【Bug】BertLayer should be used as a decoder model if cross attention is added
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recognize-anything.