error while trying to train network using multiple cpus
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hi, I'm following the super resolution image neural network example from the mathwork website. Everything works fine except utilization of multiple cpus. My GPU is old. So, I've given up gpu option. But when I try to use multiple cpus by putting following options in the 'trainNetwork' I get errors.
,...
'ExecutionEnvironment', 'parallel');
Errors are as follows:
Starting parallel pool (parpool) using the 'local' profile ...
connected to 8 workers.
Error using trainNetwork (line 154)
MiniBatchable Datastore is not distributable.
Error in trainVDSR (line 75)
net = trainNetwork(source,layers,options);
Caused by:
Error using nnet.internal.cnn.DataDispatcherFactory.createDataDispatcher (line 100)
MiniBatchable Datastore is not distributable.
Any idea why it's complaining?
Thank you, C
採用された回答
Joss Knight
2018 年 4 月 30 日
編集済み: Joss Knight
2018 年 4 月 30 日
The error means that the vdsrImagePatchDatastore does not support parallel training. This is a custom datastore created for this example. You could try adding the Distributable interface yourself to get it working.
I'll admit the error message is confusing and we should do something about it.
9 件のコメント
Amal Abdulrahman
2018 年 7 月 29 日
Hi Joss, How can I add the Distributable interface ? I checked the link and it is really confusing. Can you give me clear steps to do so ? Thanks
Joss Knight
2018 年 7 月 29 日
What is it that isn't clear? The doc link explains the steps - add the matlab.io.datastore.PartitionableByIndex mixin, add the partitionByIndex function, and it gives an example. Click on the link for partitionByIndex and it will describe the inputs and outputs of that function. If you can be specific about what you don't understand, I can elaborate.
Amal Abdulrahman
2018 年 8 月 27 日
I am trying to run the example mentioned in the above. I did the modification suggested in the doc that you provided, but now I got another error message : Error using trainNetwork (line 154) Incorrectly defined MiniBatchable Datastore. Error in partitionByIndex method of F:\UPWORK\CNN\vdsrImagePatchDatastore.m at line 357: No appropriate method, property, or field 'InputImds' for class 'vdsrImagePatchDatastore'.
Error in test_image_enlargment (line 73) net = trainNetwork(source,layers,options);
Caused by: Error using nnet.internal.cnn.validateMiniBatchDatastore>checkPartitionByIndex (line 90) Incorrectly defined MiniBatchable Datastore. Error in partitionByIndex method of F:\UPWORK\CNN\vdsrImagePatchDatastore.m at line 357: No appropriate method, property, or field 'InputImds' for class 'vdsrImagePatchDatastore'.
What shall I do ? Thank you.
Joss Knight
2018 年 8 月 31 日
You should debug your code using MATLAB's debugging tools. According to this error message, you are attempting to access a property in your partionByIndex function that doesn't exist.
Matheus Ferreira
2018 年 8 月 31 日
I have the same problem, could you please be more specific on how to debug the code?
Matheus Ferreira
2018 年 8 月 31 日
Error using trainNetwork (line 154) Incorrectly defined MiniBatchable Datastore. Error in partitionByIndex method of /media/matheus/dados/DeepLearning/TestSemanticSegmentationMatLab/PixelLabelImagePatchDatastore.m at line 223: No appropriate method, property, or field 'InputImds' for class 'PixelLabelImagePatchDatastore'.
Error in TestSemanticSegmentationMatLab (line 56) [net,info] = trainNetwork(ds,lgraph,options);
Caused by: Error using nnet.internal.cnn.validateMiniBatchDatastore>checkPartitionByIndex (line 90) Incorrectly defined MiniBatchable Datastore. Error in partitionByIndex method of /media/matheus/dados/DeepLearning/TestSemanticSegmentationMatLab/PixelLabelImagePatchDatastore.m at line 223: No appropriate method, property, or field 'InputImds' for class 'PixelLabelImagePatchDatastore'.
Joss Knight
2018 年 9 月 1 日
The documentation instructs you to implement the function partitionByIndex, and it gives an example. You are not supposed to just copy the example. In this case, the custom datastore the example is using owns a property InputImds which holds the ImageDatastore object containing the input data. The vdsrImagePatchDatastore does not contain such a property, it holds onto the data in a different way. If you are going to customize it, you'll need to investigate how it works in order to write the method appropriately.
The premise of my answer is that if you wish for this example to support parallel training, you need sufficient MATLAB programming skills to be able to author a custom class. If not, your only hope (other than learning such skills) is to hope that another person frequenting this forum has already done this and can post their code.
Matheus Ferreira
2018 年 9 月 4 日
編集済み: Matheus Ferreira
2018 年 9 月 4 日
Thank you for your prompt response. Much appreciated. I tried to implement the partitionByIndex function but I could not understand where should I insert the indices parameter in this function. I believe I should follow the implementation of shuffle, but partitionByIndex has another parameter called indices (partitionByIndex(ds, indices).
methods
function dsrand = shuffle(ds)
% To shuffle, shuffle underlying ImageDatastores
dsrand = copy(ds);
ord = randperm( numel(ds.InputImageDatastore.Files) );
dsrand.InputImageDatastore.Files = dsrand.InputImageDatastore.Files(ord);
dsrand.InputPixelLabelDatastore.shuffle(ord);
end
end
Could you please post an example of Minibatch datastore that supports parallel computing? Thank you for your help!
Joss Knight
2018 年 9 月 4 日
Sorry, this question is tantamount to asking me to write the code for you, and I unfortunately cannot oblige. Perhaps someone else is lurking here who can help?
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Image Data Workflows についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
