(self, pattern)
| 149 | return items |
| 150 | |
| 151 | def resolve_pkl(self, pattern): |
| 152 | assert isinstance(pattern, str) |
| 153 | assert pattern != '' |
| 154 | |
| 155 | # URL => return as is. |
| 156 | if dnnlib.util.is_url(pattern): |
| 157 | return pattern |
| 158 | |
| 159 | # Short-hand pattern => locate. |
| 160 | path = _locate_results(pattern) |
| 161 | |
| 162 | # Run dir => pick the last saved snapshot. |
| 163 | if os.path.isdir(path): |
| 164 | pkl_files = sorted(glob.glob(os.path.join(path, 'network-snapshot-*.pkl'))) |
| 165 | if len(pkl_files) == 0: |
| 166 | raise IOError(f'No network pickle found in "{path}"') |
| 167 | path = pkl_files[-1] |
| 168 | |
| 169 | # Normalize. |
| 170 | path = os.path.abspath(path) |
| 171 | return path |
| 172 | |
| 173 | #---------------------------------------------------------------------------- |
no test coverage detected