Comments (3)
听说是numpy新版中移除了这个函数:
numpy.asscalar(a)
将大小为1的数组转换为其标量等效值。
1.16 版后已移除: 弃用,使用 numpy.ndarray.item() 相反。
from ppq.
问题将在下一次更新中修复,你可以使用下面的写法替换 util.py
def convert_value(
value: Union[int, float, np.ndarray, torch.Tensor],
export_as_float: bool, dtype: DataType = DataType.FP32) -> Union[float, list]:
"""Converting value from any to python native data dtype, ready for export.
Args:
value (Union[int, float, np.ndarray, torch.Tensor]): exporting value.
export_as_list (bool): export value as a list.
dtype (DataType, optional): exporting dtype.
Returns:
Union[float, list]: Converted value
"""
if dtype not in {DataType.FP32, DataType.INT32}:
raise ValueError(f'Can Only export dtype fp32 and int32, '
f'while you are requiring to dump a {dtype.name} value')
value = convert_any_to_numpy(value, accepet_none=False)
value = value.astype(dtype=DataType.to_numpy(dtype))
if export_as_float:
value = value[0].item()
assert type(value) in {int, float}, (
f'Trying to dump a tensorwise quantization value {value}. '
f'It is Expected to be a int or float value, while {type(value)} was given')
return value
else:
value = convert_any_to_numpy(value, accepet_none=False)
return value.tolist()
from ppq.
问题已经在0.6.5的更新中修复
from ppq.
Related Issues (20)
- Op Execution Error: Einsum HOT 1
- yolov5量化,在ppq/samples/yolo中运行02_Quantization.py文件出现警告和报错,输出模型只有onnx没有engine文件 HOT 1
- 请问PPQ支持一维网络模型的量化吗 HOT 1
- [视频资料]使用profiler来分析网络性能,tensorboard无法解析日志文件 HOT 2
- PPQint8CPU量化bug HOT 1
- Op Execution Error MMCVModulatedDeformConv2d
- 关于QAT中的BN? HOT 1
- 是否有计划支持高通QNN(比较新的版本)和海思芯片呢? HOT 1
- ppq使用torch_mlir导出tosa格式的mlir HOT 1
- 这个工具链已经收敛了吗?我看已经比较久没有特性更新了,后续还有新特性计划吗? HOT 1
- 能否支持权重和激活位宽不同的量化? HOT 2
- VIT类模型量化感知训练loss跑飞 HOT 1
- PPQ已经支持了不少后端推理框架(TensorRT,ncnn,mnn等),这些后端的量化规格细节都是怎么获取的呢?现在PPQ与后端量化推理可以完全对齐吗?
- PPQ在画质类任务上(如低光降噪)量化效果咋样呢?
- AttributeError: 'NoneType' object has no attribute 'copy'
- 求助 为什么量化以后模型没有减小?
- ProgramEntrance_2.py读取imagenet图片reshape报错
- RuntimeError: Op Execution Error: /Slice(Type: Slice, Num of Input: 5, Num of Output: 1)
- Quantization for tflite HOT 1
- PPQ can not process parameter variable(PPQ_Variable_108) with multiple destinations HOT 3
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 ppq.