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

Allow BVLC/caffe and caffe-on-windows #769

Merged
merged 1 commit into from
Jun 2, 2016
Merged

Allow BVLC/caffe and caffe-on-windows #769

merged 1 commit into from
Jun 2, 2016

Conversation

IsaacYangSLA
Copy link
Contributor

  1. parse_version may return ('00000001','_','00000003','_final'), which is hard to to convert back to '1.0.0-rc3.' Therefore, storing the original version string as a backup for Info menu.
  2. Flavor will be NVIDIA if libcaffe.so is built with NVIDIA enhancement (Linux only). In other cases, flavor is BVLC.
  3. Store information in CaffeOption class so no need to query caffe for linked libraries twice.

"""
Errors that occur while performing tasks in unsupported platforms
"""
pass
Copy link
Contributor

@TimZaman TimZaman May 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:trollface: [no newline at end document]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


class CaffeOption(config_option.FrameworkOption):
version_string = None
flavor = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not mix instance attributes and class attributes. wtforms does that and it's super confusing.

@lukeyeager lukeyeager changed the title Retrieve version string and flavor from related files Allow BVLC/caffe May 23, 2016
@lukeyeager
Copy link
Member

I've tested this and it lets me use either BVLC/caffe or NVIDIA/caffe in DIGITS - cool!

@IsaacYangSLA
Copy link
Contributor Author

IsaacYangSLA commented May 24, 2016

I still have to keep Microsoft Caffe as one 'special case' because caffe.exe does not return version info currently. And linked library approach can't apply to Windows platform. Without such version info, validate_version raises exception.

This [PR (https://github.com/BVLC/caffe/pull/4200)], which enables Windows Caffe to report version, was just created on BVLC/Windows branch. The same one was created on Microsoft's Caffe repository, but it looked like the PR should not go there. Therefore, that one was closed and I created the new one on BVLC.

@bygreencn
Copy link

about parse_version may return ('00000001','','00000003','final'), i had it return with the same sting as on Linux, you may check bygreencn/caffe@38ff238


if version is None:
if info_dict['ver_str'] is None:
raise config_option.BadValue('Could not get version information from caffe at "%s". Are you using the NVIDIA fork?'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment about the NVIDIA fork - it's not required anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem.

@lukeyeager lukeyeager changed the title Allow BVLC/caffe Allow BVLC/caffe and caffe-on-windows Jun 1, 2016
@lukeyeager lukeyeager self-assigned this Jun 1, 2016
@IsaacYangSLA
Copy link
Contributor Author

Modified the validate_version function. When no ver_str, raising an exception. Minimum version also depends on flavor of Caffe.

@lukeyeager
Copy link
Member

Even though these checks currently work, they're misleading. Can you update them to only make the version check if the flavor is NVIDIA? BVLC/caffe > 1.0.0-rc3 (the minimum) supports all these features.

https://github.com/NVIDIA/DIGITS/blob/c0862e1611/digits/frameworks/caffe_framework.py#L37
https://github.com/NVIDIA/DIGITS/blob/c0862e1611/digits/frameworks/caffe_framework.py#L127
https://github.com/NVIDIA/DIGITS/blob/c0862e1611/digits/model/tasks/caffe_train.py#L800

@lukeyeager
Copy link
Member

Tested and everything looks right:

bvlc@rc2: fails
bvlc@rc3: succeeds
nvidia@0.10.0: fails
nvidia@0.11.1: succeeds
nvidia@0.12.2: succeeds
nvidia@0.13.2: succeeds
nvidia@0.14.5: succeeds
nvidia@0.15.1: succeeds

@lukeyeager
Copy link
Member

Neat - I tried a parallel build on Travis for NVIDIA/caffe and BVLC/caffe and they both work great:
https://travis-ci.org/lukeyeager/DIGITS/builds/134811320

@IsaacYangSLA please address #769 (comment) before merge

@IsaacYangSLA
Copy link
Contributor Author

IsaacYangSLA commented Jun 2, 2016

Thanks. There is a commit immediately below that comment. It changed the behavior of 'validate_version' so it only checks minimum version on NVIDIA flavor. Sorry that I piggybacked it with removal of Windows version workaround.
I will also check those three parts to make them compare in NVIDIA flavor only.

@lukeyeager
Copy link
Member

Now that BVLC/caffe#4200 is merged, this should work for the BVLC/caffe/windows branch, too.

@lukeyeager
Copy link
Member

Code looks good and seems to be working well - thanks for the good work!

Please squash and I'll merge.

Use master or Windows branch from BVLC fork
Parse caffe --version if available
@lukeyeager lukeyeager merged commit bdc8d21 into NVIDIA:master Jun 2, 2016
@IsaacYangSLA IsaacYangSLA deleted the dev/caffe_info branch June 17, 2016 18:59
@IsaacYangSLA IsaacYangSLA restored the dev/caffe_info branch June 17, 2016 18:59
SlipknotTN pushed a commit to cynnyx/DIGITS that referenced this pull request Mar 30, 2017
Allow BVLC/caffe and caffe-on-windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants