apple / apple/coremltools

Quiet convert mode

Open
#1,144 4 comments 1 reaction 1 assignee Claimed by @TobyRoseman View on GitHub
feature request
Dominant language
Python
Stars
5.4k
Forks
850
Avg merge
4d 5h
Merged PRs (30d)
10

Description

## 🌱 Describe your Feature Request

Add either `quiet: bool = False` or `verbosity: int` to `ct.convert()` so that users can specify their desired level of output verbosity. I have version 4.1 installed, and would be interested in contributing

## Use cases

Currently the convert function has a lot of verbose output by default such as the `tqdm` progress bar which can also get interrupted by warnings causing it to get duplicated across lines
```
Converting Frontend ==> MIL Ops: 14%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 232/1647 [00:00<00:00, 2316.07 ops/s]
WARNING:root:Tuple detected at graph output. This will be flattened in the converted model.
WARNING:root:CoreML embedding (gather) layer does not support any inputs besides the weights and indices. Those given will be ignored.
Converting Frontend ==> MIL Ops: 28%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ | 464/1647 [00:00<00:00, 1733.92 ops/s]
```

When running the conversion from a script with existing logging, this gets in the way of nicely formatted output. It'd be great to have the option to turn off all output (quiet mode or verbosity level 0)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.