Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

halfphoneUnitFeatureDefinition_ac.txt does not have any continuous features even though halfphoneFeatures_ac.mry does #503

Closed
davidflanagan opened this issue Mar 17, 2016 · 7 comments
Assignees
Labels
Milestone

Comments

@davidflanagan
Copy link
Contributor

When I create a Unit Selection voice, I get test failures in the final voice compiler step. And when I install the generated voice, the Mary server will not start up. The error is in FFRTargetCostFunction.java in the load() method:

if (!newWeights.featureEquals(featureDefinition)

That comparison fails, so the load() method throws an IOException.

I've tracked this down and found that the featureDefinition object (from the .mry file) has 3 continuous features. But newWeights (from the .txt file in the jar) does not have any continuous features listed at all. If I manually add them to the jar I can get the voice to work.

I'm not sure why the voice compiler would put the continuous features in the .mry file but not in the .txt file. But I suspect the generateFeatureWeightsFile() in FeatureDefinition.java since that is what creates the .txt file.

I see that issue #465 made changes to that method but it doesn't look like those changes would have caused this bug. It does look like there are bugs in that method, however. For example, this line:

for(int i = numByteFeatures; i < numShortFeatures; i++)

Should presumably be

for(int i = numByteFeatures; i < numByteFeatures + numShortFeatures; i++)

There aren't any short valued features in my voice, so this isn't causing a problem for me, though...

I do notice that the mary/features.txt file in the directory I build the voice in does not include unit_duration, unit_logf0 or unit_logf0delta, so maybe my problem is that I need to add these manually duing the building process? Could it be that this is just a documentation bug and that the instructions for building a voice need to be updated to include those features in the feature editor step?

@davidflanagan davidflanagan changed the title halfphoneUnitFeatureDefinition_ac.txt does not have the any continuous features even though halfphoneFeatures_ac.mry does halfphoneUnitFeatureDefinition_ac.txt does not have any continuous features even though halfphoneFeatures_ac.mry does Mar 17, 2016
@davidflanagan
Copy link
Contributor Author

FeatureSelection.java:141 calls getDiscreteFeatures() instead of getFeatures(), so the continuous features that were missing for me are not in the list of features that is presented to me by default. I'm going to change this line and try rebuilding the voice from scratch.

@davidflanagan
Copy link
Contributor Author

If I make that change above to include the continuous features, then I get a failure later on at PhoneFeatureFileWriter.java:156 because phoneUnitFeatureDefinition.txt does not include the continuous weights. If I manually edit the .txt file to add these lines:

1000 linear | unit_duration
100 linear | unit_logf0
0 linear | unit_logf0delta

Then the PhoneFeatureWriter step runs successfully. I'm confused why those lines are not being written into the file in the first place.

@davidflanagan
Copy link
Contributor Author

Same problem in the HalfPhoneFeatureFileWriter step. Editing the generated halfphoneUnitFeatureDefinition.txt to add the same lines fixes it.

@davidflanagan
Copy link
Contributor Author

But in the end, even with my patch and the edits described above, the final VoiceCompiler step still fails on the test, and fails at the same place:

marytts.unitselection.select.FFRTargetCostFunction.load(FFRTargetCostFunction.java:262

I'm beginning to think that the problem is in FeatureDefinition.java not writing out the continuous features correctly.

@seblemaguer seblemaguer self-assigned this Mar 18, 2016
@seblemaguer seblemaguer added this to the 6.0 milestone Mar 18, 2016
@davidflanagan
Copy link
Contributor Author

I think I figured this out. Just by paying closer attention to the logging output...

The first time I run the PhoneFeatureFileWriter step, it fails with

java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap

I don't understand the error, so I just run it again, and then it works. So I ignore the error and go on.
This happened each time I tried to create the voice, and I thought somehow I'd just forgotten to check the box before clicking the Run button. I thought I was operating the program wrong, and didn't investigate this as a real failure.

But the problem is that the ImmutableMap error means that the continuous features are not written out in the FeatureDefinition.generateFeatureWeightsFile() method. But the buffer does get flushed, so the file is created and next time we run, we assume the file is correct.

So I think that this is a regression caused by the patch for issue #465. Looks like that introduced a dependency on a collection library that I don't have installed by default, and that the collection library has not been added to the dependencies list in maven.

I don't know maven, so I don't know how to fix the dependency. So instead, I'll submit a pull request that just removes the ImmutableMap and uses something else.

@davidflanagan
Copy link
Contributor Author

Pull request #505 fixes this bug for me

@seblemaguer
Copy link
Member

Thanks for the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants