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
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
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.
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.
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.
I have the same problem, could you please be more specific on how to debug the code?
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'.
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!
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!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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)
