当前位置:网站首页>transforms. The input of randomcrop() can only be PIL image, not tensor
transforms. The input of randomcrop() can only be PIL image, not tensor
2022-06-26 17:51:00 【LIZHEMGHONG】
This is the original code 
Report errors :TypeError: ‘builtin_function_or_method’ object is not iterable
This is the changed code 
Report errors :TypeError: img should be PIL Image. Got <class ‘torch.Tensor’>
So I type in tensor It is not right , You should enter PIL image
However, I read a lot of information on the Internet that this function is correct tensor and PIL Fine , I don 't know which one is right , I think I can only input PIL image It can't be tensor
I replace the input with data_i_pil = transforms.ToPILImage()(data_i) After that, the program can run normally
Many people on the Internet say that this function is right tensor and PIL Fine , It's not , Let me give you an example , The following link is one of them
link :https://www.jianshu.com/p/ae695df39274
边栏推荐
- 深层次安全定义剖析及加密技术
- Leetcode HOT100 (22--- bracket generation)
- Microservice architecture practice: business management background and SSO design: SSO design
- 用redis做用户访问数据统计HyperLogLog及Bitmap高级数据类型
- KDD 2022 | 如何在跨域推荐中使用对比学习?
- Vue--vuerouter cache routing component
- padding百分比操作
- Microservice architecture practice: business management background and SSO design, SSO client design
- 关于FlowUs这一款国民好笔记
- MySQL add column failed because there was data before, not null by default
猜你喜欢

Play with Linux and easily install and configure MySQL

有依赖的背包问题

小程序设置按钮分享功能

ACL 2022 | 基于神经标签搜索的零样本多语言抽取式文本摘要
![[uniapp] the uniapp mobile terminal uses uni Troubleshooting of navigateback failure](/img/26/da00e70d0955bcdef3362474bc5fc7.png)
[uniapp] the uniapp mobile terminal uses uni Troubleshooting of navigateback failure

关于FlowUs这一款国民好笔记

sparksql如何通过日期返回具体周几-dayofweek函数

Leetcode - 226. Retourner l'arbre binaire (bfs)

Alibaba's "high concurrency" tutorial "basic + actual combat + source code + interview + Architecture" is a god class

Synchronized description of concurrency
随机推荐
Various types of gypsum PBR multi-channel mapping materials, please collect them quickly!
RSA加密解密详解
Strength and appearance Coexist -- an exclusive interview with Liu Yu, a member of Apache pulsar PMC
【QNX】命令
Rich professional product lines, and Jiangling Ford Lingrui · Jijing version is listed
离婚协议中的几个重点
[qt learning notes]qt inter thread data communication and data sharing
国信证券怎么开户?通过链接办理股票开户安全吗
Technical scheme design of chain game system development - NFT chain game system development process and source code
【动态规划】剑指 Offer II 091. 粉刷房子
Distributed Architecture Overview
9、智慧交通项目(2)
[code Capriccio - dynamic planning] t583. Deleting two strings
【uniapp】uniapp手机端使用uni.navigateBack失效问题解决
KDD 2022 | how to use comparative learning in cross domain recommendation?
How sparksql returns a specific day of the week by date -dayofweek function
pycharm的plt.show()如何保持不关闭
Using redis for user access data statistics hyperloglog and bitmap advanced data types
Secrets of gear contract
Knapsack problem with dependency