Im trying to run some open source code I downloaded from github: https://github.com/augustoqm/MCLRE
The code is running from my mac shell. When it reaches the subprocess.Popen() function it raise an "OSError: [Errno 8] Exec format error".
The code:
mrbpr_cmd_args = '%s -m %s -d %s -u %s -n %s -o %s -k %d -s %d -h %d -l %f -f %d -i %d -a %s -e "%s" -r "%s" -M %s' \ % (mrbpr_bin_path, meta_file, train_files, test_users_file, test_candidates_file, output_dir, rank_size, \ save_model, algorithm, learn_rate, num_fact, num_iter, relation_weights, regularization_per_entity, \ regularization_per_entity, model_name)
proc = subprocess.Popen(shlex.split(mrbpr_cmd_args), shell=True)
When I print "mrbpr_cmd_args" variable the results are:
/Users/nastia/Desktop/MCLRE-master/src/recommender_execution/mrbpr/mrbpr.bin -m /Users/nastia/Desktop/MCLRE-master/data/experiments/recsys-15/bpr-net_meetup.meta -d /Users/nastia/Desktop/MCLRE-master/data/partitioned_data/san_jose/partition_12/mrbpr/user-event-rsvp_train.tsv,/Users/nastia/Desktop/MCLRE-master/data/partitioned_data/san_jose/partition_12/mrbpr/user-user-same-group_train.tsv,/Users/nastia/Desktop/MCLRE-master/data/partitioned_data/san_jose/partition_12/mrbpr/user-user-same-event_train.tsv -u /Users/nastia/Desktop/MCLRE-master/data/partitioned_data/san_jose/partition_12/mrbpr/users_test.tsv -n /Users/nastia/Desktop/MCLRE-master/data/partitioned_data/san_jose/partition_12/mrbpr/event-candidates_test.tsv -o /Users/nastia/Desktop/MCLRE-master/data/experiments/recsys-15/san_jose/recommendations/partition_12/mrbpr -k 100 -s 0 -h 0 -l 0.100000 -f 200 -i 600 -a 0.25,0.15,0.6 -e "" -r "" -M BPR-NET_200-0.1-600-0.25:0.15:0.6
Can anyone please tell me what is wrong with this args?
From the README on the GitHub repo you linked:
Requirements
- Linux: all experiments were executed in Linux-based machines, Ubuntu distributions, more specifically
And, if you look at that path inside the repo, mrbpr.bin
is a Linux executable binary. You can't run that on a Mac.
If they provide the source to build that executable yourself, or a link to where to find it, you could probably build a Mac version. But, failing that, there's nothing you can do to fix it.
The best option would probably be to run a Linux container, virtual machine, or user-mode installation (either on your Mac, or on some free cloud host), install Python and all of the other requirements into that, and run the code that way.
If you're wondering why you got that particular error:
OSError: [Errno 8] Exec format error
There are a variety of different executable formats out there: a.out, ELF, mach-O, COFF, etc. Most linux executables are in ELF format. macOS's loader only knows mach-O and a.out. So, your OS can't even figure out what the file is, only that it's not a file it knows how to handle. But, even if you got past that, linux and Darwin syscalls are different, glibc and BSD libc are different, etc., so it would just quickly segfault anyway.