Error in dlnetwork/initialize in GAN
조회 수: 23 (최근 30일)
이전 댓글 표시
dlnetGenerator = dlnetwork(lgraphGenerator);
Used the code from mathworks website, Train Generative Adversarial Network (GAN) - MATLAB & Simulink (mathworks.com)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/762946/image.png)
댓글 수: 2
Walter Roberson
2021년 10월 10일
If you run the example on MATLAB Online then the function is defined at
/MATLAB Drive/Examples/R2021b/nnet/TrainGenerativeAdversarialNetworkGANExample/feature2image.m
채택된 답변
Walter Roberson
2021년 10월 10일
When you
openExample('nnet/TrainGenerativeAdversarialNetworkGANExample')
the file will be copied into the directory that is created to host the example, which would be
fullfile('MATLAB', 'Examples', 'R2021b', 'nnet', 'TrainGenerativeAdversarialNetworkGANExample', 'feature2image.m')
probably relative to your Documents directory. For example for me on MacOS it would be
/Users/roberson/Documents/MATLAB/Examples/R2021b/nnet/TrainGenerativeAdversarialNetworkGANExample/feature2image.m
The "master" copy of the file lives at
fullfile(matlabroot, 'examples', 'nnet', 'main', 'feature2image.m')
which is not on your MATLAB path. The copy there is not intended to be executed out of that location; it is intended that you use openExample() to created the correct environment.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Install Products에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!