[ FAILED ] SGDSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice<float>解决方案

在编译Caffe时遇到`FAILED SGDSolverTest/0.TestSnapshotShare`的问题。解决方法包括:尝试将BLAS从mkl改为atlas,安装libatlas-base-dev,或者更换低版本的Boost库。如果更换Boost库,详细步骤包括手动下载1.55.0版本,安装依赖,使用bootstrap.sh安装,并添加到LD_LIBRARY_PATH等。

编译caffe源码的大致过程如下:

make all

make pycaffe

make test

make runtest

小编在第N次搭建Caffe环境时,前面几步都很顺利,到最后一步make runtest这里出了问题。本来看着动漫等着make runtest运行完就去Happy,看到报错整个人都不好了。报错内容大致是这样的:

[----------] Global test environment tear-down
    [==========] 906 tests from 133 test cases ran. (72964 ms total)
    [  PASSED  ] 899 tests.
    [  FAILED  ] 7 tests, listed below:
    [  FAILED  ] SGDSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice<float>
    [  FAILED  ] AdaGradSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice<float>
    [  FAILED  ] NesterovSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice<float>
    [  FAILED  ] AdaDeltaSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice<float>
    [  FAILED  ] AdamSolverTest/0.TestSnapshotShare, where TypeParam = caffe::CPUDevice<float>
    [  FAILED  ] RMSPropSolverTest/0.TestSnapshot, where TypeParam = caffe::CP
public interface IRepository<TEntity> where TEntity : BaseEntity { /// <summary> /// EF DBContext /// </summary> VOLContext DbContext { get; } ISqlDapper DapperContext { get; } /// <summary> /// 执行事务。将在执行的方法带入Action /// </summary> /// <param name="action"></param> /// <returns></returns> WebResponseContent DbContextBeginTransaction(Func<WebResponseContent> action); /// <summary> /// 通过条件查询数据 /// </summary> /// <param name="where"></param> /// <returns></returns> List<TEntity> Find(Expression<Func<TEntity, bool>> where); /// <summary> /// /// </summary> /// <param name="predicate"></param> /// <param name="orderBySelector">排序字段,数据格式如: /// orderBy = x => new Dictionary<object, bool>() { /// { x.BalconyName,QueryOrderBy.Asc}, /// { x.TranCorpCode1,QueryOrderBy.Desc} /// }; /// /// </param> /// <returns></returns> TEntity FindFirst(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, Dictionary<object, QueryOrderBy>>> orderBy = null); /// <summary> /// /// </summary> /// <param name="predicate">where条件</param> /// <param name="orderBy">排序字段,数据格式如: /// orderBy = x => new Dictionary<object, bool>() { /// { x.BalconyName,QueryOrderBy.Asc}, /// { x.TranCorpCode1,QueryOrderBy.Desc} /// }; /// </param> /// <returns></returns> IQueryable<TEntity> FindAsIQueryable(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, Dictionary<object, QueryOrderBy>>> orderBy = null); /// <summary> /// 通过条件查询数据 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="predicate">查询条件</param> /// <param name="selector">返回类型如:Find(x => x.UserName == loginInfo.userName, p => new { uname = p.UserName });</param> /// <returns></returns> List<T> Find<T>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, T>> selector); /// <summary> /// 根据条件,返回查询的类 /// </summary> /// <typeparam name="TFind"></typeparam> /// <param name="predicate"></param> /// <returns></returns> List<TFind> Find<TFind>(Expression<Func<TFind, bool>> predicate) where TFind : class; Task<TFind> FindAsyncFirst<TFind>(Expression<Func<TFind, bool>> predicate) where TFind : class; Task<TEntity> FindAsyncFirst(Expression<Func<TEntity, bool>> predicate); Task<List<TFind>> FindAsync<TFind>(Expression<Func<TFind, bool>> predicate) where TFind : class; Task<TEntity> FindFirstAsync(Expression<Func<TEntity, bool>> predicate); Task<List<TEntity>> FindAsync(Expression<Func<TEntity, bool>> predicate); Task<List<T>> FindAsync<T>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, T>> selector); Task<T> FindFirstAsync<T>(Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, T>> selector); /// <summary> /// 多条件查询 /// </summary> /// <typeparam name="Source"></typeparam> /// <param name="sources">要查询的多个条件的数据源</param> /// <param name="predicate">生成的查询条件</param> /// <returns></returns> List<TEntity> Find<Source>(IEnumerable<Source> sources, Func<Source, Expression<Func<TEntity, bool>>> predicate) where Source : class; /// <summary> /// 多条件查询 /// </summary> /// <typeparam name="Source"></typeparam> /// <param name="sources">要查询的多个条件的数据源</param> /// <param name="predicate">生成的查询条件</param> /// <param name="selector">自定义返回结果</param> /// <returns></returns> List<TResult> Find<Source, TResult>(IEnumerable<Source> sources, Func<Source, Expression<Func<TEntity, bool>>> predicate, Expression<Func<TEntity, TResult>> selector) where Source : class; /// <summary> /// 多条件查询 /// </summary> /// <typeparam name="Source"></typeparam> /// <param name="sources">要查询的多个条件的数据源</param> /// <param name="predicate">生成的查询条件</param> /// <returns></returns> IQueryable<TEntity> FindAsIQueryable<Source>(IEnumerable<Source> sources, Func<Source, Expression<Func<TEntity, bool>>> predicate) where Source : class; Task<bool> ExistsAsync(Expression<Func<TEntity, bool>> predicate); bool Exists(Expression<Func<TEntity, bool>> predicate); bool Exists<TExists>(Expression<Func<TExists, bool>> predicate) where TExists : class; Task<bool> ExistsAsync<TExists>(Expression<Func<TExists, bool>> predicate) where TExists : class; IIncludableQueryable<TEntity, TProperty> Include<TProperty>(Expression<Func<TEntity, TProperty>> incluedProperty); /// <summary> /// /// </summary> /// <typeparam name="TResult"></typeparam> /// <param name="pageIndex"></param> /// <param name="pagesize"></param> /// <param name="rowcount"></param> /// <param name="predicate"></param> /// <param name="orderBy"> /// 通过多个字段排序Expression<Func<TEntity, Dictionary<object, bool>>> /// orderBy = x => new Dictionary<object, bool>() { /// { x.BalconyName,QueryOrderBy.Asc}, /// { x.TranCorpCode1,QueryOrderBy.Desc} /// }; /// <param name="selectorResult">查询返回的对象</param> /// <returns></returns> List<TResult> QueryByPage<TResult>(int pageIndex, int pagesize, out int rowcount, Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, Dictionary<object, QueryOrderBy>>> orderBySelector, Expression<Func<TEntity, TResult>> selectorResult, bool returnRowCount = true); List<TResult> QueryByPage<TResult>(int pageIndex, int pagesize, Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, Dictionary<object, QueryOrderBy>>> orderBy, Expression<Func<TEntity, TResult>> selectorResult = null); /// <summary> /// /// </summary> /// <param name="pageIndex"></param> /// <param name="pagesize"></param> /// <param name="rowcount"></param> /// <param name="predicate"></param> /// <param name="orderBy"></param> /// /// 通过多个字段排序Expression<Func<TEntity, Dictionary<object, bool>>> /// orderBy = x => new Dictionary<object, bool>() { /// { x.BalconyName,QueryOrderBy.Asc}, /// { x.TranCorpCode1,QueryOrderBy.Desc} /// }; /// <returns></returns> List<TEntity> QueryByPage(int pageIndex, int pagesize, out int rowcount, Expression<Func<TEntity, bool>> predicate, Expression<Func<TEntity, Dictionary<object, QueryOrderBy>>> orderBy, bool returnRowCount = true); IQueryable<TFind> IQueryablePage<TFind>(int pageIndex, int pagesize, out int rowcount, Expression<Func<TFind, bool>> predicate, Expression<Func<TEntity, Dictionary<object, QueryOrderBy>>> orderBy, bool returnRowCount = true) where TFind : class; IQueryable<TEntity> IQueryablePage(IQueryable<TEntity> queryable, int pageIndex, int pagesize, out int rowcount, Dictionary<string, QueryOrderBy> orderBy, bool returnRowCount = true); /// <summary> /// /// </summary> /// <param name="entity"></param> /// <param name="properties">指定更新字段:x=>new {x.Name,x.Enable}</param> /// <param name="saveChanges">是否保存</param> /// <returns></returns> int Update(TEntity entity, Expression<Func<TEntity, object>> properties, bool saveChanges = false); /// <summary> /// /// </summary> /// <param name="entity"></param> /// <param name="properties">指定更新字段:x=>new {x.Name,x.Enable}</param> /// <param name="saveChanges">是否保存</param> /// <returns></returns> int Update<TSource>(TSource entity, Expression<Func<TSource, object>> properties, bool saveChanges = false) where TSource : class; int Update<TSource>(TSource entity, bool saveChanges = false) where TSource : class; int Update<TSource>(TSource entity, string[] properties, bool saveChanges = false) where TSource : class; int UpdateRange<TSource>(IEnumerable<TSource> entities, bool saveChanges = false) where TSource : class; /// <summary> /// /// </summary> /// <param name="entity"></param> /// <param name="properties">指定更新字段:x=>new {x.Name,x.Enable}</param> /// <param name="saveChanges">是否保存</param> /// <returns></returns> int UpdateRange<TSource>(IEnumerable<TSource> models, Expression<Func<TSource, object>> properties, bool saveChanges = false) where TSource : class; int UpdateRange<TSource>(IEnumerable<TSource> entities, string[] properties, bool saveChanges = false) where TSource : class; /// <summary> ///修改时同时对明细的添加、删除、修改 /// </summary> /// <param name="entity"></param> /// <param name="updateDetail">是否修改明细</param> /// <param name="delNotExist">是否删除明细不存在的数据</param> /// <param name="updateMainFields">主表指定修改字段</param> /// <param name="updateDetailFields">明细指定修改字段</param> /// <param name="saveChange">是否保存</param> /// <returns></returns> WebResponseContent UpdateRange<Detail>(TEntity entity, bool updateDetail = false, bool delNotExist = false, Expression<Func<TEntity, object>> updateMainFields = null, Expression<Func<Detail, object>> updateDetailFields = null, bool saveChange = false) where Detail : class; void Delete(TEntity model, bool saveChanges=false); /// <summary> /// /// </summary> /// <param name="keys"></param> /// <param name="delList">是否将子表的数据也删除</param> /// <returns></returns> int DeleteWithKeys(object[] keys, bool delList = false); void Add(TEntity entities, bool SaveChanges = false); void AddRange(IEnumerable<TEntity> entities, bool SaveChanges = false); Task AddAsync(TEntity entities); Task AddRangeAsync(IEnumerable<TEntity> entities); void AddRange<T>(IEnumerable<T> entities, bool saveChanges = false) where T : class; void BulkInsert(IEnumerable<TEntity> entities, bool setOutputIdentity = false); int SaveChanges(); Task<int> SaveChangesAsync(); int ExecuteSqlCommand(string sql, params SqlParameter[] sqlParameters); List<TEntity> FromSql(string sql, params SqlParameter[] sqlParameters); /// <summary> /// 执行sql /// 使用方式 FormattableString sql=$"select * from xx where name ={xx} and pwd={xx1} ", /// FromSqlInterpolated内部处理sql注入的问题,直接在{xx}写对应的值即可 /// 注意:sql必须 select * 返回所有TEntity字段, /// </summary> /// <param name="formattableString"></param> /// <returns></returns> IQueryable<TEntity> FromSqlInterpolated([System.Diagnostics.CodeAnalysis.NotNull] FormattableString sql); /// <summary> /// 取消上下文跟踪 /// 更新报错时,请调用此方法:The instance of entity type 'XXX' cannot be tracked because another instance with the same key value for {'XX'} is already being tracked. /// </summary> /// <param name="entity"></param> void Detached(TEntity entity); void DetachedRange(IEnumerable<TEntity> entities); }
08-01
public interface IService<T> where T : BaseEntity { ICacheService CacheContext { get; } Microsoft.AspNetCore.Http.HttpContext Context { get; } /// <summary> /// 前端查询条件转换为EF查询Queryable(2023.04.02) /// </summary> /// <param name="options">前端查询参数</param> /// <param name="useTenancy">是否使用数据隔离</param> /// <returns></returns> IQueryable<T> GetPageDataQueryFilter(PageDataOptions options, bool useTenancy = true); /// <summary> /// 查询 /// </summary> /// <param name="pageData"></param> /// <returns></returns> PageGridData<T> GetPageData(PageDataOptions pageData); object GetDetailPage(PageDataOptions pageData); WebResponseContent Upload(List<IFormFile> files); WebResponseContent DownLoadTemplate(); WebResponseContent Import(List<IFormFile> files); /// <summary> /// 导出 /// </summary> /// <param name="pageData"></param> /// <returns></returns> WebResponseContent Export(PageDataOptions pageData); /// <summary> /// 新增 /// </summary> /// <param name="saveDataModel">主表与子表的数据</param> /// <returns></returns> WebResponseContent Add(SaveModel saveDataModel); /// <summary> /// /// </summary> /// <param name="entity">保存的实体</param> /// <param name="validationEntity">是否对实体进行校验</param> /// <returns></returns> WebResponseContent AddEntity(T entity, bool validationEntity = true); /// <summary> /// /// </summary> /// <typeparam name="TDetail"></typeparam> /// <param name="entity">保存的实体</param> /// <param name="list">保存的明细</param> /// <param name="validationEntity">是否对实体进行校验</param> /// <returns></returns> WebResponseContent Add<TDetail>(T entity, List<TDetail> list = null, bool validationEntity = true) where TDetail : class; /// <summary> /// 编辑 /// </summary> /// <param name="saveDataModel">主表与子表的数据</param> /// <returns></returns> WebResponseContent Update(SaveModel saveDataModel); /// <summary> /// 删除数据 /// </summary> /// <param name="keys">删除的主键</param> /// <param name="delList">是否删除对应明细(默认会删除明细)</param> /// <returns></returns> WebResponseContent Del(object[] keys, bool delList = true); WebResponseContent Audit(object[] id, int? auditStatus, string auditReason); (string, T, bool) ApiValidate(string bizContent, Expression<Func<T, object>> expression = null); /// <summary> /// /// </summary> /// <typeparam name="TInput"></typeparam> /// <param name="bizContent"></param> /// <param name="expression">对指属性验证格式如:x=>new { x.UserName,x.Value }</param> /// <returns>(string,TInput, bool) string:返回验证消息,TInput:bizContent序列化后的对象,bool:验证是否通过</returns> (string, TInput, bool) ApiValidateInput<TInput>(string bizContent, Expression<Func<TInput, object>> expression); /// <summary> /// /// </summary> /// <typeparam name="TInput"></typeparam> /// <param name="bizContent"></param> /// <param name="expression">对指属性验证格式如:x=>new { x.UserName,x.Value }</param> /// <param name="validateExpression">对指定的字段只做合法性判断比如长度是是否超长</param> /// <returns>(string,TInput, bool) string:返回验证消息,TInput:bizContent序列化后的对象,bool:验证是否通过</returns> (string, TInput, bool) ApiValidateInput<TInput>(string bizContent, Expression<Func<TInput, object>> expression, Expression<Func<TInput, object>> validateExpression); /// <summary> /// 将数据源映射到新的数据中,List<TSource>映射到List<TResult>或TSource映射到TResult /// 目前只支持Dictionary或实体类型 /// </summary> /// <typeparam name="TSource"></typeparam> /// <typeparam name="TResult"></typeparam> /// <param name="source"></param> /// <param name="resultExpression">只映射返回对象的指定字段</param> /// <param name="sourceExpression">只映射数据源对象的指定字段</param> /// 过滤条件表达式调用方式:List表达式x => new { x[0].MenuName, x[0].Menu_Id},表示指定映射MenuName,Menu_Id字段 /// List<Sys_Menu> list = new List<Sys_Menu>(); /// list.MapToObject<List<Sys_Menu>, List<Sys_Menu>>(x => new { x[0].MenuName, x[0].Menu_Id}, null); /// ///过滤条件表达式调用方式:实体表达式x => new { x.MenuName, x.Menu_Id},表示指定映射MenuName,Menu_Id字段 /// Sys_Menu sysMenu = new Sys_Menu(); /// sysMenu.MapToObject<Sys_Menu, Sys_Menu>(x => new { x.MenuName, x.Menu_Id}, null); /// <returns></returns> TResult MapToEntity<TSource, TResult>(TSource source, Expression<Func<TResult, object>> resultExpression, Expression<Func<TSource, object>> sourceExpression = null) where TResult : class; /// <summary> /// 将一个实体的赋到另一个实体上,应用场景: /// 两个实体,a a1= new a();b b1= new b(); a1.P=b1.P; a1.Name=b1.Name; /// </summary> /// <typeparam name="TSource"></typeparam> /// <typeparam name="TResult"></typeparam> /// <param name="source"></param> /// <param name="result"></param> /// <param name="expression">指定对需要的字段赋值,格式x=>new {x.Name,x.P},返回的结果只会对Name与P赋值</param> void MapValueToEntity<TSource, TResult>(TSource source, TResult result, Expression<Func<TResult, object>> expression = null) where TResult : class; }
08-01
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值