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

[bug] No such file or directory when porting a project from windows to linux #814

Closed
sanzoghenzo opened this issue Mar 4, 2020 · 10 comments
Labels
bug for actual bugs (unsure? use type:question)

Comments

@sanzoghenzo
Copy link

sanzoghenzo commented Mar 4, 2020

Describe the bug
related to #472
I'm trying to reuse a project chat comes from windows (non CUDA equipped) on my linux (CUDA enabled) computer.
After adding the "CUDA nodes", if I try to run the workflow I got an error in the PrepareDenseScene node (the first node that I added):

Program called with the following parameters:
 * evCorrection = 0
 * input = "/home/sanzo/Documents/RifugioAntiaereo/MeshroomCache/StructureFromMotion/8b1eb208dabd66f6b8217585101d147bc86f12b1/sfm.abc"
 * output = "/home/sanzo/Documents/RifugioAntiaereo/MeshroomCache/PrepareDenseScene/d7b6378f935b072434ba6022e5180768b280caf5"
 * outputFileType = "exr"
 * rangeSize = 40
 * rangeStart = 0
 * saveMatricesTxtFiles = 0
 * saveMetadata = 1
 * verboseLevel = "info"

terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
  what():  boost::filesystem::canonical: No such file or directory: "/home/sanzo/Documents/RifugioAntiaereo/MeshroomCache/StructureFromMotion/8b1eb208dabd66f6b8217585101d147bc86f12b1/..\..\FeatureExtraction\41b423ea1e1291f89ca3ee8715f74deb3c81885a"
Aborted

Here's the status:

{
    "status": "ERROR",
    "execMode": "LOCAL",
    "nodeName": "PrepareDenseScene_1",
    "nodeType": "PrepareDenseScene",
    "packageName": "aliceVision",
    "packageVersion": null,
    "graph": "",
    "commandLine": "aliceVision_prepareDenseScene  --input \"/home/sanzo/Documents/RifugioAntiaereo/MeshroomCache/StructureFromMotion/8b1eb208dabd66f6b8217585101d147bc86f12b1/sfm.abc\" --outputFileType exr --saveMetadata True --saveMatricesTxtFiles False --evCorrection False --verboseLevel info --output \"/home/sanzo/Documents/RifugioAntiaereo/MeshroomCache/PrepareDenseScene/d7b6378f935b072434ba6022e5180768b280caf5\" --rangeStart 0 --rangeSize 40",
    "env": null,
    "startDateTime": "2020-03-05 07:23:30.043549",
    "endDateTime": "",
    "elapsedTime": 0,
    "hostname": "sanzoLaptop",
    "sessionUid": "a7b091e0-5ea9-11ea-aaaa-b17e08150d35",
    "returnCode": 134,
    "elapsedTimeStr": "0:00:00"
}

As you can see, paths in the ".mg" file are correctly changed, parameters are correctly passed, but the FeatureExtraction path is compose incorrectly (mixed POSIX and Windows path).

This is due to the cameras.sfm file that contains the relative path for featureFolders and matchesFolders:

{
    "version": [
        "1",
        "0",
        "0"
    ],
    "featuresFolders": [
        "..\\..\\FeatureExtraction\\41b423ea1e1291f89ca3ee8715f74deb3c81885a"
    ],
    "matchesFolders": [
        "..\\..\\FeatureMatching\\074d901176bc4f4238b694fb550032ea76f2812c"
    ],
    "views": [
       ...
   ]
}

(It also contains the original photo path, but that's something for #472).

The path is then composed simply by concatenating the two parts without normalizing it.

EDIT: I thought I can solve this by changing the path in the cameras.sfm file, but the error persists. Is it that the relative path is stored inside the sfm.abc binary file?

I don't know if this is something that Meshroom needs to address (change the paths inside every file used by the project) or if AliceVision needs to be smarter about paths reconstruction.

To Reproduce
Steps to reproduce the behavior:

  1. Create and run a project on windows with draft meshing only
  2. move the project to linux
  3. add the nodes for dense scene and depth map creation
  4. compute PrepareDenseScene
  5. See error

Desktop:

  • Meshroom version:
    • Binary version 2019.2.0 in both windows and linux
@sanzoghenzo sanzoghenzo added the bug for actual bugs (unsure? use type:question) label Mar 4, 2020
@natowi
Copy link
Member

natowi commented Mar 4, 2020

You can edit the paths in the .mg file.

@sanzoghenzo
Copy link
Author

Actually, the problematic part of the path is in the .sfm file.
I don't know if this should be handled by meshroom or directly by alicevision

@natowi
Copy link
Member

natowi commented Mar 4, 2020

You can manually set the sfm file as input in the nodes

@simogasp
Copy link
Member

simogasp commented Mar 4, 2020

Also don't use spaces in your path.
Place your files in paths that does not contain spaces, i.e as in /home/sanzo/Documents/Meshroom_-_Rifugio_Antiaereo_Lavis/Me....

@sanzoghenzo
Copy link
Author

Thanks for the responses, I've updated the issue with more information to clear things out.

Meshroom is doing a good job handling the paths, the problem lies in the cameras.sfm file that has a windows style relative path, and the final path is simply a concatenation of the two without any normalization.

(BTW: Spaces have never been a problem, but I tried with a simpler path anyway, leading to the same error.)

@natowi
Copy link
Member

natowi commented Mar 5, 2020

You can also search and replace the paths within the sfm file.

@sanzoghenzo
Copy link
Author

I did it and nothing changed.
The relative path is stored inside the sfm.abc file, which is binary, so there's little meshroom can do here.
I'll open an issue in the alicevision repo.

@simogasp
Copy link
Member

simogasp commented Mar 5, 2020

see #472
The thing is, even if u change the paths, that it may invalidate the UID associated to each image, which among other things may be computed using the full path (as part of the hash function)

@fabiencastan
Copy link
Member

The filepath is only used in the UID if you don't have the mandatory metadata in your image file.

@fabiencastan
Copy link
Member

Yes, there is a problem in the SfMData applying canonical to the internal paths (to features and matches).
If the conversion to the canonical path failed it stops the process and it shouldn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug for actual bugs (unsure? use type:question)
Projects
None yet
Development

No branches or pull requests

4 participants