hollance / Forge

A neural network toolkit for Metal
MIT License
1.27k stars 172 forks source link

`[MPSTemporaryImage prefetchStorageWithCommandBuffer:imageDescriptorList:] Error: the descriptor must be configured with MTLStorageModePrivate' #20

Closed chanmi closed 6 years ago

chanmi commented 7 years ago

Hi. I'm trying to run the YOLO application of this project. When I try it, this error occurs.

failed assertion `[MPSTemporaryImage prefetchStorageWithCommandBuffer:imageDescriptorList:] Error: the descriptor must be configured with MTLStorageModePrivate'

in YOLO.swift line 69, which calls models.swift line 306.

I edited DataShape.swift line 52, from

return MPSImageDescriptor(channelFormat: .float16, width: width,
                              height: height, featureChannels: channels) 

to

return MPSImageDescriptor(channelFormat: .float16, width: width,
                              height: height, featureChannels: channels,
                              storageMode: .private) // and MTLStorageMode.private instead of .private

but it doesn't work announcing "Expression type 'MPSImageDescriptor' is ambiguous without more context". I'm working on Xcode 9 and iOS 11. (is it the reason?) What can I do for it? Thank you.

hollance commented 7 years ago

Please use the xcode9 branch. It has fixes for these issues. :smile: