Closed HerrBertling closed 5 years ago
if you are compiling from source, the location depends on whether the #RELEASE flag is defined as you'll see in ofApp -- there's some weirdness with the new macs not interpreting relative paths the same way as before. we'll need to reevaluate this because the paths have been giving us trouble for a while now.
I noticed this same problem, and it seems like you've already fixed the line on ofApp.cpp to reflect the change that HerrBertling mentioned. I ran the shell script as referenced, but when I go to Add Samples in the app, the app crashes and I'm still getting the error in the console:
[ error ] Can't find network file ../../../data/../../../../data/image-net-2012.sqlite3 [notice ] Adding samples...
Any ideas why this might still be happening?
(sorry if it's too much to be raising issues on multiple threads, but obviously just started playing around with these OF apps, and would love to get them working on my machine)
Not sure if this could be the source, but the only other relevant place where I could find the ../../../data
that's concatenated on to the beginning of the correct path (../../../../data/image-net-2012.sqlite3
) is in the ofUtils.cpp file from Open Frameworks.
In that file, starting at L64:
string defaultDataPath(){
#if defined TARGET_OSX
try{
return std::filesystem::canonical(ofFilePath::join(ofFilePath::getCurrentExeDir(), "../../../data/")).string();
}catch(...){
return ofFilePath::join(ofFilePath::getCurrentExeDir(), "../../../data/");
}
Since I'm using OSX, I thought this could maybe be part of the issue. Based on my uneducated look at what this snippet of code is doing, it doesn't seem like it's the culprit, but is the only place I could find that might be connected with the faulty path.
Maybe this helps, maybe it's nothing.
try to remove the ofToDataPath
in the link to the sql file or provide it an absolute path. i'm not exactly sure what's going wrong here.
Hey! That seemed to work! Will play around with the app and see if I run into anything else, but thanks so much for your help!
If anyone else runs into this problem -- here's what I had to do:
ofToDataPath()
from line 22 (I removed it from line 20, too, just to make sure). So, that line now reads: ccv.setup("../../../../data/image-net-2012.sqlite3");
This might be a bit of a hack, but it got the app up and running for me! Looking forward to playing with it.
this may also be caused by newer macs running translocation on all applications. if you run the setup script setup.sh
first that will fix this, or moving the application to another folder, then moving it back will also give it access back to the files.
Some train of thought and exploration about this issue with the relevant question at the end :wink: 🚂
I get this error when trying to "Add samples":
Thread 1: EXC_BAD_ACCESS (code=1, address=0x18)
Up until then, I can adjust the threshold, min/max and It seems to happen here in the "hack" line, as far as I can tell from what XCode highlights:
My app is in a different folder than the openFramework stuff, but from what I understood, this shouldn't be a problem.
Also, the XCode console says:
which I already wondered about since it is a relative path to a file.
Using the
ml4a-ofx/apps/DoodleClassifier
folder with adjustments to the.xml
file produces the same error.Running
sh setup.sh
did create theimage-net-2012.sqlite3
file – not withindata
but directly withinml4a-ofx
. Adjusting the path to that file in https://github.com/ml4a/ml4a-ofx/blob/master/apps/DoodleClassifier/src/ofApp.cpp#L22 (which would then sayccv.setup(ofToDataPath("../../../../image-net-2012.sqlite3"));
apparently fixes this issue.Is this path wrong in general or am I holding it wrong and my setup needs to be fixed? :blush: