fix b1c6nbt model invalid mid_num_channels setting. #976
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
When running b1c6nbt with c++ engine, it will trigger this error.
terminate called after throwing an instance of 'StringError' what(): Error loading or parsing model file /b1c6nbt-s31704192-d83750556/model.bin.gz: trunk: all numbers of channels must be positive
trunk exported here
def write_trunk(name,model):
writeln("trunk")
writeln(len(model.blocks))
writeln(model.c_trunk)
writeln(model.c_mid)
writeln(model.c_mid-model.c_gpool)
writeln(model.c_gpool)
writeln(model.c_gpool)
Error thrown here
TrunkDesc::TrunkDesc(istream& in, int vrsn, bool binaryFloats) {
in >> name;
version = vrsn;
in >> numBlocks;
in >> trunkNumChannels;
in >> midNumChannels;
in >> regularNumChannels;
int dilatedNumChannels; //unused
in >> dilatedNumChannels;
in >> gpoolNumChannels;
if(in.fail())
throw StringError(name + ": trunk failed to parse num blocks or various channel parameters");
if(numBlocks < 1)
throw StringError(name + ": trunk num blocks must be positive");
if(
trunkNumChannels <= 0 || midNumChannels <= 0 || regularNumChannels <= 0 ||
gpoolNumChannels <= 0)
throw StringError(name + ": all numbers of channels must be positive");